Skip to content

Commit aeb9aa3

Browse files
authored
Remove type alias _CallableElement in ElementTree (#14476)
Remove _CallableElement and make _ElementCallable recursive
1 parent a3b9d1b commit aeb9aa3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

stdlib/xml/etree/ElementTree.pyi

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ def canonicalize(
8080
# The tag for Element can be set to the Comment or ProcessingInstruction
8181
# functions defined in this module.
8282
_ElementCallable: TypeAlias = Callable[..., Element[_ElementCallable]]
83-
_CallableElement: TypeAlias = Element[_ElementCallable]
8483

8584
_Tag = TypeVar("_Tag", default=str, bound=str | _ElementCallable)
8685
_OtherTag = TypeVar("_OtherTag", default=str, bound=str | _ElementCallable)
@@ -137,8 +136,8 @@ class Element(Generic[_Tag]):
137136
def __bool__(self) -> bool: ...
138137

139138
def SubElement(parent: Element, tag: str, attrib: dict[str, str] = ..., **extra: str) -> Element: ...
140-
def Comment(text: str | None = None) -> _CallableElement: ...
141-
def ProcessingInstruction(target: str, text: str | None = None) -> _CallableElement: ...
139+
def Comment(text: str | None = None) -> Element[_ElementCallable]: ...
140+
def ProcessingInstruction(target: str, text: str | None = None) -> Element[_ElementCallable]: ...
142141

143142
PI = ProcessingInstruction
144143

0 commit comments

Comments
 (0)