mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-23 04:11:28 +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:
@@ -3,7 +3,7 @@ from collections.abc import Callable, Mapping, MutableMapping
|
||||
from typing import Any
|
||||
from typing_extensions import TypeAlias
|
||||
from xml.sax import handler
|
||||
from xml.sax.xmlreader import XMLReader
|
||||
from xml.sax.xmlreader import AttributesImpl, XMLReader
|
||||
|
||||
from netaddr.core import Publisher, Subscriber
|
||||
from netaddr.ip import IPAddress, IPNetwork, IPRange
|
||||
@@ -14,7 +14,7 @@ IANA_INFO: dict[str, dict[_IanaInfoKey, dict[str, str]]]
|
||||
|
||||
class SaxRecordParser(handler.ContentHandler):
|
||||
def __init__(self, callback: Callable[[Mapping[str, object] | None], object] | None = None) -> None: ...
|
||||
def startElement(self, name: str, attrs: Mapping[str, object]) -> None: ...
|
||||
def startElement(self, name: str, attrs: AttributesImpl) -> None: ...
|
||||
def endElement(self, name: str) -> None: ...
|
||||
def characters(self, content: str) -> None: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user