mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
stdlib/xml/sax: Add type annotations (#10606)
* stdlib/xml/sax: Type annotations for commonly used methods. * stdlib/xml/sax: More annotations. It turns out SAX's definition of a "qname" is exactly the opposite of ElementTree's. With that understanding, let's annotate the Attributes*Impl classes too. * stdlib/xml/sax: I better understand what AttributesNSImpl is doing now. * Update third-party library stubs to agree with the new SAX annotations.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from collections.abc import Iterator, Mapping
|
||||
from typing import Any
|
||||
from typing_extensions import Self
|
||||
from xml.sax import handler
|
||||
from xml.sax import handler, xmlreader
|
||||
|
||||
def is_string(x: object) -> bool: ...
|
||||
|
||||
@@ -29,7 +29,7 @@ class Handler(handler.ContentHandler):
|
||||
root: Element
|
||||
elements: list[Element]
|
||||
def __init__(self) -> None: ...
|
||||
def startElement(self, name: str, attributes: Mapping[str, Any]) -> None: ...
|
||||
def startElement(self, name: str, attributes: xmlreader.AttributesImpl) -> None: ...
|
||||
def endElement(self, name: str) -> None: ...
|
||||
def characters(self, cdata: str) -> None: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user