Improve ipaddress dunders (#7244)

This commit is contained in:
Alex Waygood
2022-02-17 02:55:39 +00:00
committed by GitHub
parent 35bddd289f
commit d869f2e5a3

View File

@@ -18,12 +18,6 @@ def ip_network(address: _RawIPAddress | _RawNetworkPart, strict: bool = ...) ->
def ip_interface(address: _RawIPAddress | _RawNetworkPart) -> IPv4Interface | IPv6Interface: ...
class _IPAddressBase:
def __eq__(self, __other: object) -> bool: ...
def __ge__(self: Self, __other: Self) -> bool: ...
def __gt__(self: Self, __other: Self) -> bool: ...
def __le__(self: Self, __other: Self) -> bool: ...
def __lt__(self: Self, __other: Self) -> bool: ...
def __ne__(self, __other: object) -> bool: ...
@property
def compressed(self) -> str: ...
@property
@@ -39,6 +33,18 @@ class _BaseAddress(_IPAddressBase, SupportsInt):
def __hash__(self) -> int: ...
def __int__(self) -> int: ...
def __sub__(self: Self, other: int) -> Self: ...
def __format__(self, fmt: str) -> str: ...
def __eq__(self, other: object) -> bool: ...
def __lt__(self: Self, other: Self) -> bool: ...
if sys.version_info >= (3, 11):
def __ge__(self: Self, other: Self) -> bool: ...
def __gt__(self: Self, other: Self) -> bool: ...
def __le__(self: Self, other: Self) -> bool: ...
else:
def __ge__(self: Self, other: Self, NotImplemented: Any = ...) -> bool: ...
def __gt__(self: Self, other: Self, NotImplemented: Any = ...) -> bool: ...
def __le__(self: Self, other: Self, NotImplemented: Any = ...) -> bool: ...
@property
def is_global(self) -> bool: ...
@property
@@ -65,6 +71,17 @@ class _BaseNetwork(_IPAddressBase, Container[_A], Iterable[_A], Generic[_A]):
def __contains__(self, other: Any) -> bool: ...
def __getitem__(self, n: int) -> _A: ...
def __iter__(self) -> Iterator[_A]: ...
def __eq__(self, other: object) -> bool: ...
def __lt__(self: Self, other: Self) -> bool: ...
if sys.version_info >= (3, 11):
def __ge__(self: Self, other: Self) -> bool: ...
def __gt__(self: Self, other: Self) -> bool: ...
def __le__(self: Self, other: Self) -> bool: ...
else:
def __ge__(self: Self, other: Self, NotImplemented: Any = ...) -> bool: ...
def __gt__(self: Self, other: Self, NotImplemented: Any = ...) -> bool: ...
def __le__(self: Self, other: Self, NotImplemented: Any = ...) -> bool: ...
def address_exclude(self: Self, other: Self) -> Iterator[Self]: ...
@property
def broadcast_address(self) -> _A: ...