Skip to content

Commit 3a56e00

Browse files
authored
xml.etree: Fix tag param in __init__ (#10968)
1 parent 1965076 commit 3a56e00

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

stdlib/xml/etree/ElementTree.pyi

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class Element:
8686
attrib: dict[str, str]
8787
text: str | None
8888
tail: str | None
89-
def __init__(self, tag: str | Callable[..., Element], attrib: dict[str, str] = ..., **extra: str) -> None: ...
89+
def __init__(self, tag: str, attrib: dict[str, str] = ..., **extra: str) -> None: ...
9090
def append(self, __subelement: Element) -> None: ...
9191
def clear(self) -> None: ...
9292
def extend(self, __elements: Iterable[Element]) -> None: ...
@@ -132,7 +132,7 @@ def SubElement(parent: Element, tag: str, attrib: dict[str, str] = ..., **extra:
132132
def Comment(text: str | None = None) -> Element: ...
133133
def ProcessingInstruction(target: str, text: str | None = None) -> Element: ...
134134

135-
PI: Callable[..., Element]
135+
PI = ProcessingInstruction
136136

137137
class QName:
138138
text: str

stubs/openpyxl/openpyxl/xml/_functions_overloads.pyi

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ _T_co = TypeVar("_T_co", covariant=True)
1616

1717
# Comment from openpyxl.cell.rich_text.py
1818
# Usually an Element() from either lxml or xml.etree (has a 'tag' element)
19+
# lxml.etree._Element
20+
# xml.etree.Element
1921
class _HasTag(Protocol):
20-
tag: Any # AnyOf[str, None, Callable[..., AnyOf[str, None]]]
22+
tag: str
2123

2224
class _HasGet(Protocol[_T_co]):
2325
def get(self, __value: str) -> _T_co | None: ...

0 commit comments

Comments
 (0)