Review SupportsInt and SupportsFloat usages in 3rd-party stubs (#11003)

This commit is contained in:
Avasam
2023-12-18 08:14:37 -05:00
committed by GitHub
parent fd3228a2e2
commit 91b35bb5f5
3 changed files with 15 additions and 10 deletions

View File

@@ -1,5 +1,6 @@
from typing import ClassVar, SupportsInt, overload
from typing_extensions import Literal, Self, SupportsIndex
from _typeshed import ConvertibleToInt
from typing import ClassVar, overload
from typing_extensions import Literal, Self
from netaddr.core import DictDotLookup
from netaddr.ip import IPAddress
@@ -40,7 +41,7 @@ class EUI(BaseIdentifier):
@property
def value(self) -> int: ...
@value.setter
def value(self, value: str | SupportsInt | SupportsIndex) -> None: ...
def value(self, value: ConvertibleToInt) -> None: ...
@property
def dialect(self) -> type[mac_eui48 | eui64_base]: ...
@dialect.setter
@@ -77,7 +78,7 @@ class EUI(BaseIdentifier):
def bin(self) -> str: ...
def eui64(self) -> Self: ...
def modified_eui64(self) -> Self: ...
def ipv6(self, prefix: str | SupportsInt | SupportsIndex) -> IPAddress: ...
def ipv6(self, prefix: ConvertibleToInt) -> IPAddress: ...
def ipv6_link_local(self) -> IPAddress: ...
@property
def info(self) -> DictDotLookup: ...

View File

@@ -1,4 +1,4 @@
from _typeshed import Incomplete, Unused
from _typeshed import ConvertibleToInt, Incomplete, Unused
from abc import abstractmethod
from collections.abc import Iterable, Iterator
from typing import SupportsInt, overload
@@ -71,9 +71,9 @@ class IPAddress(BaseIP):
def ipv4(self) -> Self: ...
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: ...
def __or__(self, other: SupportsInt | SupportsIndex) -> Self: ...
def __and__(self, other: SupportsInt | SupportsIndex) -> Self: ...
def __xor__(self, other: SupportsInt | SupportsIndex) -> Self: ...
def __lshift__(self, numbits: int) -> Self: ...
def __rshift__(self, numbits: int) -> Self: ...
def __bool__(self) -> bool: ...
@@ -148,7 +148,7 @@ class IPRange(BaseIP, IPListMixin):
def cidrs(self) -> list[IPNetwork]: ...
def iter_unique_ips(*args: IPRange | _IPNetworkAddr) -> Iterator[IPAddress]: ...
def cidr_abbrev_to_verbose(abbrev_cidr: str | SupportsInt | SupportsIndex) -> str: ...
def cidr_abbrev_to_verbose(abbrev_cidr: ConvertibleToInt) -> str: ...
def cidr_merge(ip_addrs: Iterable[IPRange | _IPNetworkAddr]) -> list[IPNetwork]: ...
def cidr_exclude(target: _IPNetworkAddr, exclude: _IPNetworkAddr) -> list[IPNetwork]: ...
def cidr_partition(