stdlib: add __slots__ (#14611)

This commit is contained in:
Jelle Zijlstra
2025-08-21 07:24:59 -07:00
committed by GitHub
parent 28abff1eb3
commit f32d9f08bd
38 changed files with 247 additions and 12 deletions
+8 -2
View File
@@ -39,12 +39,15 @@ if sys.version_info < (3, 11):
MAX_CACHE_SIZE: Final[int]
class _ResultMixinStr:
__slots__ = ()
def encode(self, encoding: str = "ascii", errors: str = "strict") -> _ResultMixinBytes: ...
class _ResultMixinBytes:
__slots__ = ()
def decode(self, encoding: str = "ascii", errors: str = "strict") -> _ResultMixinStr: ...
class _NetlocResultMixinBase(Generic[AnyStr]):
__slots__ = ()
@property
def username(self) -> AnyStr | None: ...
@property
@@ -55,8 +58,11 @@ class _NetlocResultMixinBase(Generic[AnyStr]):
def port(self) -> int | None: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
class _NetlocResultMixinStr(_NetlocResultMixinBase[str], _ResultMixinStr): ...
class _NetlocResultMixinBytes(_NetlocResultMixinBase[bytes], _ResultMixinBytes): ...
class _NetlocResultMixinStr(_NetlocResultMixinBase[str], _ResultMixinStr):
__slots__ = ()
class _NetlocResultMixinBytes(_NetlocResultMixinBase[bytes], _ResultMixinBytes):
__slots__ = ()
class _DefragResultBase(NamedTuple, Generic[AnyStr]):
url: AnyStr