mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-03-12 18:06:45 +08:00
xml.etree: Fix tag param in __init__ (#10968)
This commit is contained in:
@@ -86,7 +86,7 @@ class Element:
|
||||
attrib: dict[str, str]
|
||||
text: str | None
|
||||
tail: str | None
|
||||
def __init__(self, tag: str | Callable[..., Element], attrib: dict[str, str] = ..., **extra: str) -> None: ...
|
||||
def __init__(self, tag: str, attrib: dict[str, str] = ..., **extra: str) -> None: ...
|
||||
def append(self, __subelement: Element) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
def extend(self, __elements: Iterable[Element]) -> None: ...
|
||||
@@ -132,7 +132,7 @@ def SubElement(parent: Element, tag: str, attrib: dict[str, str] = ..., **extra:
|
||||
def Comment(text: str | None = None) -> Element: ...
|
||||
def ProcessingInstruction(target: str, text: str | None = None) -> Element: ...
|
||||
|
||||
PI: Callable[..., Element]
|
||||
PI = ProcessingInstruction
|
||||
|
||||
class QName:
|
||||
text: str
|
||||
|
||||
@@ -16,8 +16,10 @@ _T_co = TypeVar("_T_co", covariant=True)
|
||||
|
||||
# Comment from openpyxl.cell.rich_text.py
|
||||
# Usually an Element() from either lxml or xml.etree (has a 'tag' element)
|
||||
# lxml.etree._Element
|
||||
# xml.etree.Element
|
||||
class _HasTag(Protocol):
|
||||
tag: Any # AnyOf[str, None, Callable[..., AnyOf[str, None]]]
|
||||
tag: str
|
||||
|
||||
class _HasGet(Protocol[_T_co]):
|
||||
def get(self, __value: str) -> _T_co | None: ...
|
||||
|
||||
Reference in New Issue
Block a user