mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-14 22:21:44 +08:00
Stdlib: add many missing __hash__ and __eq__ methods (#10464)
This commit is contained in:
@@ -78,6 +78,7 @@ class _BaseNetwork(_IPAddressBase, Container[_A], Iterable[_A], Generic[_A]):
|
||||
def __getitem__(self, n: int) -> _A: ...
|
||||
def __iter__(self) -> Iterator[_A]: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __lt__(self, other: Self) -> bool: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
def __ge__(self, other: Self) -> bool: ...
|
||||
@@ -148,7 +149,10 @@ class _BaseV4:
|
||||
|
||||
class IPv4Address(_BaseV4, _BaseAddress): ...
|
||||
class IPv4Network(_BaseV4, _BaseNetwork[IPv4Address]): ...
|
||||
class IPv4Interface(IPv4Address, _BaseInterface[IPv4Address, IPv4Network]): ...
|
||||
|
||||
class IPv4Interface(IPv4Address, _BaseInterface[IPv4Address, IPv4Network]):
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
class _BaseV6:
|
||||
@property
|
||||
@@ -169,11 +173,16 @@ class IPv6Address(_BaseV6, _BaseAddress):
|
||||
@property
|
||||
def scope_id(self) -> str | None: ...
|
||||
|
||||
def __hash__(self) -> int: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
|
||||
class IPv6Network(_BaseV6, _BaseNetwork[IPv6Address]):
|
||||
@property
|
||||
def is_site_local(self) -> bool: ...
|
||||
|
||||
class IPv6Interface(IPv6Address, _BaseInterface[IPv6Address, IPv6Network]): ...
|
||||
class IPv6Interface(IPv6Address, _BaseInterface[IPv6Address, IPv6Network]):
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
def v4_int_to_packed(address: int) -> bytes: ...
|
||||
def v6_int_to_packed(address: int) -> bytes: ...
|
||||
|
||||
Reference in New Issue
Block a user