Skip to content

Commit 4394453

Browse files
DanMeonclaude
andcommitted
fix(types): py3.10 pyright 의 Self ↔ HwpDocument 호환 처리
변경사항: - nodes.py 의 to_markdown / to_html 의 render_markdown / render_html 호출에 # type: ignore[arg-type] 추가 - pyright 1.1.409 부터 Self 타입과 nominal class 가 다르게 추론되어 py3.10 lint matrix 에서 fail (1.1.408 까지는 통과). 동일 클래스 호출이라 안전 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d550010 commit 4394453

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

python/rhwp/ir/nodes.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,8 @@ def to_markdown(self) -> str:
751751
"""
752752
from rhwp.ir._view import render_markdown
753753

754-
return render_markdown(self)
754+
# ^ py3.10 pyright 가 Self 와 nominal HwpDocument 를 다르게 처리 — 동일 클래스라 호출 정합
755+
return render_markdown(self) # type: ignore[arg-type]
755756

756757
def to_html(self, *, include_css: bool = False) -> str:
757758
"""IR → 완전 HTML5 문서 (``<!DOCTYPE html>`` + ``<html>`` + ``<head>`` + ``<body>``).
@@ -770,7 +771,8 @@ def to_html(self, *, include_css: bool = False) -> str:
770771
"""
771772
from rhwp.ir._view import render_html
772773

773-
return render_html(self, include_css=include_css)
774+
# ^ py3.10 pyright 가 Self 와 nominal HwpDocument 를 다르게 처리 — 동일 클래스라 호출 정합
775+
return render_html(self, include_css=include_css) # type: ignore[arg-type]
774776

775777

776778
def _walk_blocks(blocks: Sequence["Block"], recurse: bool) -> Iterator["Block"]:

0 commit comments

Comments
 (0)