mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-07-19 22:50:29 +08:00
stdlib: add __slots__ (#14611)
This commit is contained in:
@@ -22,6 +22,7 @@ def ip_interface(
|
||||
) -> IPv4Interface | IPv6Interface: ...
|
||||
|
||||
class _IPAddressBase:
|
||||
__slots__ = ()
|
||||
@property
|
||||
def compressed(self) -> str: ...
|
||||
@property
|
||||
@@ -33,6 +34,7 @@ class _IPAddressBase:
|
||||
def version(self) -> int: ...
|
||||
|
||||
class _BaseAddress(_IPAddressBase):
|
||||
__slots__ = ()
|
||||
def __add__(self, other: int) -> Self: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __int__(self) -> int: ...
|
||||
@@ -105,6 +107,7 @@ class _BaseNetwork(_IPAddressBase, Generic[_A]):
|
||||
def hostmask(self) -> _A: ...
|
||||
|
||||
class _BaseV4:
|
||||
__slots__ = ()
|
||||
if sys.version_info >= (3, 14):
|
||||
version: Final = 4
|
||||
max_prefixlen: Final = 32
|
||||
@@ -115,6 +118,7 @@ class _BaseV4:
|
||||
def max_prefixlen(self) -> Literal[32]: ...
|
||||
|
||||
class IPv4Address(_BaseV4, _BaseAddress):
|
||||
__slots__ = ("_ip", "__weakref__")
|
||||
def __init__(self, address: object) -> None: ...
|
||||
@property
|
||||
def is_global(self) -> bool: ...
|
||||
@@ -156,6 +160,7 @@ class IPv4Interface(IPv4Address):
|
||||
def with_prefixlen(self) -> str: ...
|
||||
|
||||
class _BaseV6:
|
||||
__slots__ = ()
|
||||
if sys.version_info >= (3, 14):
|
||||
version: Final = 6
|
||||
max_prefixlen: Final = 128
|
||||
@@ -166,6 +171,7 @@ class _BaseV6:
|
||||
def max_prefixlen(self) -> Literal[128]: ...
|
||||
|
||||
class IPv6Address(_BaseV6, _BaseAddress):
|
||||
__slots__ = ("_ip", "_scope_id", "__weakref__")
|
||||
def __init__(self, address: object) -> None: ...
|
||||
@property
|
||||
def is_global(self) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user