[netaddr]: Annotate missing parameter types (#14990)

This commit is contained in:
lev-blit
2025-11-07 18:05:25 +02:00
committed by GitHub
parent ec2714cdb9
commit ba57b7dd32
2 changed files with 12 additions and 9 deletions
+4 -1
View File
@@ -1,6 +1,7 @@
from _typeshed import ConvertibleToInt, Unused
from abc import abstractmethod
from collections.abc import Iterable, Iterator
from types import ModuleType
from typing import Literal, SupportsIndex, SupportsInt, overload
from typing_extensions import Self, TypeAlias
@@ -95,7 +96,9 @@ class IPListMixin:
def __contains__(self, other: BaseIP | _IPAddressAddr) -> bool: ...
def __bool__(self) -> Literal[True]: ...
def parse_ip_network(module, addr: tuple[int, int] | str, flags: int = 0, *, expand_partial: bool = False) -> tuple[int, int]: ...
def parse_ip_network(
module: ModuleType, addr: tuple[int, int] | str, flags: int = 0, *, expand_partial: bool = False
) -> tuple[int, int]: ...
class IPNetwork(BaseIP, IPListMixin):
__slots__ = ("_prefixlen",)
+8 -8
View File
@@ -1,9 +1,9 @@
from _typeshed import Incomplete, SupportsWrite
from _typeshed import SupportsWrite
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 AttributesImpl, XMLReader
from xml.sax import _Source, handler
from xml.sax.xmlreader import AttributesImpl, InputSource, XMLReader
from netaddr.core import Publisher, Subscriber
from netaddr.ip import IPAddress, IPNetwork, IPRange
@@ -20,8 +20,8 @@ class SaxRecordParser(handler.ContentHandler):
class XMLRecordParser(Publisher):
xmlparser: XMLReader
fh: Incomplete
def __init__(self, fh, **kwargs: object) -> None: ...
fh: InputSource | _Source
def __init__(self, fh: InputSource | _Source, **kwargs: object) -> None: ...
def process_record(self, rec: Mapping[str, object]) -> dict[str, str] | None: ...
def consume_record(self, rec: object) -> None: ...
def parse(self) -> None: ...
@@ -41,11 +41,11 @@ class MulticastParser(XMLRecordParser):
def normalise_addr(self, addr: str) -> str: ...
class DictUpdater(Subscriber):
dct: MutableMapping[_IanaInfoKey, Incomplete]
dct: MutableMapping[_IanaInfoKey, dict[str, Any]]
topic: str
unique_key: str
def __init__(self, dct: MutableMapping[_IanaInfoKey, Incomplete], topic: str, unique_key: str) -> None: ...
def update(self, data) -> None: ...
def __init__(self, dct: MutableMapping[_IanaInfoKey, dict[str, Any]], topic: str, unique_key: str) -> None: ...
def update(self, data: dict[str, Any]) -> None: ...
def load_info() -> None: ...
def pprint_info(fh: SupportsWrite[str] | None = None) -> None: ...