mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-03-05 14:44:18 +08:00
Add defaults for third-party stubs M-O (#9956)
This commit is contained in:
@@ -2,6 +2,6 @@ from netaddr.ip import IPNetwork, _IPAddressAddr
|
||||
|
||||
class SubnetSplitter:
|
||||
def __init__(self, base_cidr: _IPAddressAddr) -> None: ...
|
||||
def extract_subnet(self, prefix: int, count: int | None = ...) -> list[IPNetwork]: ...
|
||||
def extract_subnet(self, prefix: int, count: int | None = None) -> list[IPNetwork]: ...
|
||||
def available_subnets(self) -> list[IPNetwork]: ...
|
||||
def remove_subnet(self, ip_network: IPNetwork) -> None: ...
|
||||
|
||||
@@ -22,7 +22,7 @@ class Subscriber:
|
||||
class PrettyPrinter(Subscriber):
|
||||
fh: SupportsWrite[str]
|
||||
write_eol: bool
|
||||
def __init__(self, fh: SupportsWrite[str] = ..., write_eol: bool = ...) -> None: ...
|
||||
def __init__(self, fh: SupportsWrite[str] = ..., write_eol: bool = True) -> None: ...
|
||||
def update(self, data: object) -> None: ...
|
||||
|
||||
class Publisher:
|
||||
|
||||
@@ -21,21 +21,21 @@ class OUI(BaseIdentifier):
|
||||
def __ne__(self, other: object) -> bool: ...
|
||||
@property
|
||||
def reg_count(self) -> int: ...
|
||||
def registration(self, index: int = ...) -> DictDotLookup: ...
|
||||
def registration(self, index: int = 0) -> DictDotLookup: ...
|
||||
|
||||
class IAB(BaseIdentifier):
|
||||
IAB_EUI_VALUES: ClassVar[tuple[int, int]]
|
||||
@classmethod
|
||||
def split_iab_mac(cls, eui_int: int, strict: bool = ...) -> tuple[int, int]: ...
|
||||
def split_iab_mac(cls, eui_int: int, strict: bool = False) -> tuple[int, int]: ...
|
||||
record: dict[str, object]
|
||||
def __init__(self, iab: str | int, strict: bool = ...) -> None: ...
|
||||
def __init__(self, iab: str | int, strict: bool = False) -> None: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __ne__(self, other: object) -> bool: ...
|
||||
def registration(self) -> DictDotLookup: ...
|
||||
|
||||
class EUI(BaseIdentifier):
|
||||
def __init__(
|
||||
self, addr: EUI | int | str, version: int | None = ..., dialect: type[mac_eui48] | type[eui64_base] | None = ...
|
||||
self, addr: EUI | int | str, version: int | None = None, dialect: type[mac_eui48] | type[eui64_base] | None = None
|
||||
) -> None: ...
|
||||
@property
|
||||
def value(self) -> int: ...
|
||||
@@ -68,7 +68,7 @@ class EUI(BaseIdentifier):
|
||||
def __le__(self, other: EUI | int | str) -> bool: ...
|
||||
def __gt__(self, other: EUI | int | str) -> bool: ...
|
||||
def __ge__(self, other: EUI | int | str) -> bool: ...
|
||||
def bits(self, word_sep: str | None = ...) -> str: ...
|
||||
def bits(self, word_sep: str | None = None) -> str: ...
|
||||
@property
|
||||
def packed(self) -> bytes: ...
|
||||
@property
|
||||
@@ -81,4 +81,4 @@ class EUI(BaseIdentifier):
|
||||
def ipv6_link_local(self) -> IPAddress: ...
|
||||
@property
|
||||
def info(self) -> DictDotLookup: ...
|
||||
def format(self, dialect: type[mac_eui48] | type[eui64_base] | None = ...) -> str: ...
|
||||
def format(self, dialect: type[mac_eui48] | type[eui64_base] | None = None) -> str: ...
|
||||
|
||||
@@ -41,7 +41,7 @@ _IPAddressAddr: TypeAlias = BaseIP | int | str
|
||||
_IPNetworkAddr: TypeAlias = IPNetwork | IPAddress | tuple[int, int] | str
|
||||
|
||||
class IPAddress(BaseIP):
|
||||
def __init__(self, addr: _IPAddressAddr, version: Literal[4, 6] | None = ..., flags: int = ...) -> None: ...
|
||||
def __init__(self, addr: _IPAddressAddr, version: Literal[4, 6] | None = None, flags: int = 0) -> None: ...
|
||||
def netmask_bits(self) -> int: ...
|
||||
def is_hostmask(self) -> bool: ...
|
||||
def is_netmask(self) -> bool: ...
|
||||
@@ -59,7 +59,7 @@ class IPAddress(BaseIP):
|
||||
def __hex__(self) -> str: ...
|
||||
def __index__(self) -> int: ...
|
||||
def __bytes__(self) -> bytes: ...
|
||||
def bits(self, word_sep: str | None = ...) -> str: ...
|
||||
def bits(self, word_sep: str | None = None) -> str: ...
|
||||
@property
|
||||
def packed(self) -> bytes: ...
|
||||
@property
|
||||
@@ -69,8 +69,8 @@ class IPAddress(BaseIP):
|
||||
@property
|
||||
def reverse_dns(self) -> str: ...
|
||||
def ipv4(self) -> Self: ...
|
||||
def ipv6(self, ipv4_compatible: bool = ...) -> Self: ...
|
||||
def format(self, dialect: type[ipv6_verbose] | None = ...) -> str: ...
|
||||
def ipv6(self, ipv4_compatible: bool = False) -> Self: ...
|
||||
def format(self, dialect: type[ipv6_verbose] | None = None) -> str: ...
|
||||
def __or__(self, other: str | SupportsInt | SupportsIndex) -> Self: ...
|
||||
def __and__(self, other: str | SupportsInt | SupportsIndex) -> Self: ...
|
||||
def __xor__(self, other: str | SupportsInt | SupportsIndex) -> Self: ...
|
||||
@@ -93,12 +93,12 @@ class IPListMixin:
|
||||
def __bool__(self) -> Literal[True]: ...
|
||||
|
||||
def parse_ip_network(
|
||||
module: Incomplete, addr: tuple[int, int] | str, implicit_prefix: bool = ..., flags: int = ...
|
||||
module: Incomplete, addr: tuple[int, int] | str, implicit_prefix: bool = False, flags: int = 0
|
||||
) -> tuple[int, int]: ...
|
||||
|
||||
class IPNetwork(BaseIP, IPListMixin):
|
||||
def __init__(
|
||||
self, addr: _IPNetworkAddr, implicit_prefix: bool = ..., version: Literal[4, 6] | None = ..., flags: int = ...
|
||||
self, addr: _IPNetworkAddr, implicit_prefix: bool = False, version: Literal[4, 6] | None = None, flags: int = 0
|
||||
) -> None: ...
|
||||
@property
|
||||
def prefixlen(self) -> int: ...
|
||||
@@ -129,15 +129,15 @@ class IPNetwork(BaseIP, IPListMixin):
|
||||
def key(self) -> tuple[int, ...]: ...
|
||||
def sort_key(self) -> tuple[int, ...]: ...
|
||||
def ipv4(self) -> Self: ...
|
||||
def ipv6(self, ipv4_compatible: bool = ...) -> Self: ...
|
||||
def previous(self, step: int = ...) -> Self: ...
|
||||
def next(self, step: int = ...) -> Self: ...
|
||||
def supernet(self, prefixlen: int = ...) -> list[IPNetwork]: ...
|
||||
def subnet(self, prefixlen: int, count: int | None = ..., fmt: Unused = None) -> Iterator[Self]: ...
|
||||
def ipv6(self, ipv4_compatible: bool = False) -> Self: ...
|
||||
def previous(self, step: int = 1) -> Self: ...
|
||||
def next(self, step: int = 1) -> Self: ...
|
||||
def supernet(self, prefixlen: int = 0) -> list[IPNetwork]: ...
|
||||
def subnet(self, prefixlen: int, count: int | None = None, fmt: Unused = None) -> Iterator[Self]: ...
|
||||
def iter_hosts(self) -> Iterator[IPAddress]: ...
|
||||
|
||||
class IPRange(BaseIP, IPListMixin):
|
||||
def __init__(self, start: _IPAddressAddr, end: _IPAddressAddr, flags: int = ...) -> None: ...
|
||||
def __init__(self, start: _IPAddressAddr, end: _IPAddressAddr, flags: int = 0) -> None: ...
|
||||
def __contains__(self, other: BaseIP | _IPAddressAddr) -> bool: ...
|
||||
@property
|
||||
def first(self) -> int: ...
|
||||
@@ -155,7 +155,7 @@ def cidr_partition(
|
||||
target: _IPNetworkAddr, exclude: _IPNetworkAddr
|
||||
) -> tuple[list[IPNetwork], list[IPNetwork], list[IPNetwork]]: ...
|
||||
def spanning_cidr(ip_addrs: Iterable[_IPNetworkAddr]) -> IPNetwork: ...
|
||||
def iter_iprange(start: _IPAddressAddr, end: _IPAddressAddr, step: SupportsInt | SupportsIndex = ...) -> Iterator[IPAddress]: ...
|
||||
def iter_iprange(start: _IPAddressAddr, end: _IPAddressAddr, step: SupportsInt | SupportsIndex = 1) -> Iterator[IPAddress]: ...
|
||||
def iprange_to_cidrs(start: _IPNetworkAddr, end: _IPNetworkAddr) -> list[IPNetwork]: ...
|
||||
def smallest_matching_cidr(ip: _IPAddressAddr, cidrs: Iterable[_IPNetworkAddr]) -> IPNetwork | None: ...
|
||||
def largest_matching_cidr(ip: _IPAddressAddr, cidrs: Iterable[_IPNetworkAddr]) -> IPNetwork | None: ...
|
||||
|
||||
@@ -13,7 +13,7 @@ _IanaInfoKey: TypeAlias = IPAddress | IPNetwork | IPRange
|
||||
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: ...
|
||||
def __init__(self, callback: Callable[[Mapping[str, object] | None], object] | None = None) -> None: ...
|
||||
def startElement(self, name: str, attrs: Mapping[str, object]) -> None: ...
|
||||
def endElement(self, name: str) -> None: ...
|
||||
def characters(self, content: str) -> None: ...
|
||||
@@ -48,5 +48,5 @@ class DictUpdater(Subscriber):
|
||||
def update(self, data: Incomplete) -> None: ...
|
||||
|
||||
def load_info() -> None: ...
|
||||
def pprint_info(fh: SupportsWrite[str] | None = ...) -> None: ...
|
||||
def pprint_info(fh: SupportsWrite[str] | None = None) -> None: ...
|
||||
def query(ip_addr: IPAddress) -> dict[str, list[dict[str, str]]]: ...
|
||||
|
||||
@@ -7,19 +7,19 @@ from netaddr.ip import IPAddress, IPNetwork, IPRange, _IPNetworkAddr
|
||||
_IPIterable: TypeAlias = IPNetwork | IPRange | IPSet | Iterable[_IPNetworkAddr | IPRange | int]
|
||||
|
||||
class IPSet:
|
||||
def __init__(self, iterable: _IPIterable | None = ..., flags: int = ...) -> None: ...
|
||||
def __init__(self, iterable: _IPIterable | None = None, flags: int = 0) -> None: ...
|
||||
def compact(self) -> None: ...
|
||||
def __hash__(self) -> NoReturn: ...
|
||||
def __contains__(self, ip: _IPNetworkAddr) -> bool: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def __iter__(self) -> Iterator[IPAddress]: ...
|
||||
def iter_cidrs(self) -> list[IPNetwork]: ...
|
||||
def add(self, addr: IPRange | _IPNetworkAddr | int, flags: int = ...) -> None: ...
|
||||
def remove(self, addr: IPRange | _IPNetworkAddr | int, flags: int = ...) -> None: ...
|
||||
def add(self, addr: IPRange | _IPNetworkAddr | int, flags: int = 0) -> None: ...
|
||||
def remove(self, addr: IPRange | _IPNetworkAddr | int, flags: int = 0) -> None: ...
|
||||
def pop(self) -> IPNetwork: ...
|
||||
def isdisjoint(self, other: IPSet) -> bool: ...
|
||||
def copy(self) -> Self: ...
|
||||
def update(self, iterable: _IPIterable, flags: int = ...) -> None: ...
|
||||
def update(self, iterable: _IPIterable, flags: int = 0) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __ne__(self, other: object) -> bool: ...
|
||||
|
||||
@@ -7,9 +7,9 @@ BYTES_TO_BITS: list[str]
|
||||
def valid_words(words: Iterable[int], word_size: int, num_words: int) -> bool: ...
|
||||
def int_to_words(int_val: int, word_size: int, num_words: int) -> tuple[int, ...]: ...
|
||||
def words_to_int(words: Sequence[int], word_size: int, num_words: int) -> int: ...
|
||||
def valid_bits(bits: str, width: int, word_sep: str = ...) -> bool: ...
|
||||
def bits_to_int(bits: str, width: int, word_sep: str = ...) -> int: ...
|
||||
def int_to_bits(int_val: int, word_size: int, num_words: int, word_sep: str = ...) -> str: ...
|
||||
def valid_bits(bits: str, width: int, word_sep: str = "") -> bool: ...
|
||||
def bits_to_int(bits: str, width: int, word_sep: str = "") -> int: ...
|
||||
def int_to_bits(int_val: int, word_size: int, num_words: int, word_sep: str = "") -> str: ...
|
||||
def valid_bin(bin_val: str, width: int) -> bool: ...
|
||||
def int_to_bin(int_val: int, width: int) -> str: ...
|
||||
def bin_to_int(bin_val: str, width: int) -> int: ...
|
||||
|
||||
@@ -29,15 +29,15 @@ RE_MAC_FORMATS: list[Pattern[str]]
|
||||
|
||||
def valid_str(addr: str) -> bool: ...
|
||||
def str_to_int(addr: str) -> int: ...
|
||||
def int_to_str(int_val: int, dialect: type[mac_eui48] | None = ...) -> str: ...
|
||||
def int_to_str(int_val: int, dialect: type[mac_eui48] | None = None) -> str: ...
|
||||
def int_to_packed(int_val: int) -> bytes: ...
|
||||
def packed_to_int(packed_int: bytes) -> int: ...
|
||||
def valid_words(words: Iterable[int], dialect: type[mac_eui48] | None = ...) -> bool: ...
|
||||
def int_to_words(int_val: int, dialect: type[mac_eui48] | None = ...) -> tuple[int, ...]: ...
|
||||
def words_to_int(words: Sequence[int], dialect: type[mac_eui48] | None = ...) -> int: ...
|
||||
def valid_bits(bits: str, dialect: type[mac_eui48] | None = ...) -> bool: ...
|
||||
def bits_to_int(bits: str, dialect: type[mac_eui48] | None = ...) -> int: ...
|
||||
def int_to_bits(int_val: int, dialect: type[mac_eui48] | None = ...) -> str: ...
|
||||
def valid_bin(bin_val: str, dialect: type[mac_eui48] | None = ...) -> bool: ...
|
||||
def valid_words(words: Iterable[int], dialect: type[mac_eui48] | None = None) -> bool: ...
|
||||
def int_to_words(int_val: int, dialect: type[mac_eui48] | None = None) -> tuple[int, ...]: ...
|
||||
def words_to_int(words: Sequence[int], dialect: type[mac_eui48] | None = None) -> int: ...
|
||||
def valid_bits(bits: str, dialect: type[mac_eui48] | None = None) -> bool: ...
|
||||
def bits_to_int(bits: str, dialect: type[mac_eui48] | None = None) -> int: ...
|
||||
def int_to_bits(int_val: int, dialect: type[mac_eui48] | None = None) -> str: ...
|
||||
def valid_bin(bin_val: str, dialect: type[mac_eui48] | None = None) -> bool: ...
|
||||
def int_to_bin(int_val: int) -> str: ...
|
||||
def bin_to_int(bin_val: str) -> int: ...
|
||||
|
||||
@@ -28,15 +28,15 @@ RE_EUI64_FORMATS: list[Pattern[str]]
|
||||
|
||||
def valid_str(addr: str) -> bool: ...
|
||||
def str_to_int(addr: str) -> int: ...
|
||||
def int_to_str(int_val: int, dialect: type[eui64_base] | None = ...) -> str: ...
|
||||
def int_to_str(int_val: int, dialect: type[eui64_base] | None = None) -> str: ...
|
||||
def int_to_packed(int_val: int) -> bytes: ...
|
||||
def packed_to_int(packed_int: bytes) -> int: ...
|
||||
def valid_words(words: Iterable[int], dialect: type[eui64_base] | None = ...) -> bool: ...
|
||||
def int_to_words(int_val: int, dialect: type[eui64_base] | None = ...) -> tuple[int, ...]: ...
|
||||
def words_to_int(words: Sequence[int], dialect: type[eui64_base] | None = ...) -> int: ...
|
||||
def valid_bits(bits: str, dialect: type[eui64_base] | None = ...) -> bool: ...
|
||||
def bits_to_int(bits: str, dialect: type[eui64_base] | None = ...) -> int: ...
|
||||
def int_to_bits(int_val: int, dialect: type[eui64_base] | None = ...) -> str: ...
|
||||
def valid_bin(bin_val: str, dialect: type[eui64_base] | None = ...) -> bool: ...
|
||||
def valid_words(words: Iterable[int], dialect: type[eui64_base] | None = None) -> bool: ...
|
||||
def int_to_words(int_val: int, dialect: type[eui64_base] | None = None) -> tuple[int, ...]: ...
|
||||
def words_to_int(words: Sequence[int], dialect: type[eui64_base] | None = None) -> int: ...
|
||||
def valid_bits(bits: str, dialect: type[eui64_base] | None = None) -> bool: ...
|
||||
def bits_to_int(bits: str, dialect: type[eui64_base] | None = None) -> int: ...
|
||||
def int_to_bits(int_val: int, dialect: type[eui64_base] | None = None) -> str: ...
|
||||
def valid_bin(bin_val: str, dialect: type[eui64_base] | None = None) -> bool: ...
|
||||
def int_to_bin(int_val: int) -> str: ...
|
||||
def bin_to_int(bin_val: str) -> int: ...
|
||||
|
||||
@@ -21,8 +21,8 @@ netmask_to_prefix: dict[int, int]
|
||||
prefix_to_hostmask: dict[int, int]
|
||||
hostmask_to_prefix: dict[int, int]
|
||||
|
||||
def valid_str(addr: str, flags: int = ...) -> bool: ...
|
||||
def str_to_int(addr: str, flags: int = ...) -> int: ...
|
||||
def valid_str(addr: str, flags: int = 0) -> bool: ...
|
||||
def str_to_int(addr: str, flags: int = 0) -> int: ...
|
||||
def int_to_str(int_val: int, dialect: Unused = None) -> str: ...
|
||||
def int_to_arpa(int_val: int) -> str: ...
|
||||
def int_to_packed(int_val: int) -> bytes: ...
|
||||
@@ -32,7 +32,7 @@ def int_to_words(int_val: int) -> tuple[int, ...]: ...
|
||||
def words_to_int(words: Sequence[int]) -> int: ...
|
||||
def valid_bits(bits: str) -> bool: ...
|
||||
def bits_to_int(bits: str) -> int: ...
|
||||
def int_to_bits(int_val: int, word_sep: str | None = ...) -> str: ...
|
||||
def int_to_bits(int_val: int, word_sep: str | None = None) -> str: ...
|
||||
def valid_bin(bin_val: str) -> bool: ...
|
||||
def int_to_bin(int_val: int) -> str: ...
|
||||
def bin_to_int(bin_val: str) -> int: ...
|
||||
|
||||
@@ -27,18 +27,18 @@ class ipv6_compact:
|
||||
class ipv6_full(ipv6_compact): ...
|
||||
class ipv6_verbose(ipv6_compact): ...
|
||||
|
||||
def valid_str(addr: str, flags: int = ...) -> bool: ...
|
||||
def str_to_int(addr: str, flags: int = ...) -> int: ...
|
||||
def int_to_str(int_val: int, dialect: type[ipv6_compact] | None = ...) -> str: ...
|
||||
def valid_str(addr: str, flags: int = 0) -> bool: ...
|
||||
def str_to_int(addr: str, flags: int = 0) -> int: ...
|
||||
def int_to_str(int_val: int, dialect: type[ipv6_compact] | None = None) -> str: ...
|
||||
def int_to_arpa(int_val: int) -> str: ...
|
||||
def int_to_packed(int_val: int) -> bytes: ...
|
||||
def packed_to_int(packed_int: bytes) -> int: ...
|
||||
def valid_words(words: Iterable[int]) -> bool: ...
|
||||
def int_to_words(int_val: int, num_words: int | None = ..., word_size: int | None = ...) -> tuple[int, ...]: ...
|
||||
def int_to_words(int_val: int, num_words: int | None = None, word_size: int | None = None) -> tuple[int, ...]: ...
|
||||
def words_to_int(words: Sequence[int]) -> int: ...
|
||||
def valid_bits(bits: str) -> bool: ...
|
||||
def bits_to_int(bits: str) -> int: ...
|
||||
def int_to_bits(int_val: int, word_sep: str | None = ...) -> str: ...
|
||||
def int_to_bits(int_val: int, word_sep: str | None = None) -> str: ...
|
||||
def valid_bin(bin_val: str) -> bool: ...
|
||||
def int_to_bin(int_val: int) -> str: ...
|
||||
def bin_to_int(bin_val: str) -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user