Add __slots__ to third-party packages using stubdefaulter (#14619)

This commit is contained in:
Jelle Zijlstra
2025-08-21 15:38:13 -07:00
committed by GitHub
parent 573b57d8da
commit ca44e4c45d
135 changed files with 675 additions and 25 deletions
+2
View File
@@ -51,6 +51,7 @@ class FastIterOrderedMultiDict(OrderedMultiDict[_KT, _VT]): # undocumented
def iterkeys(self, multi: bool = False) -> Generator[_KT, None, None]: ...
class OneToOne(dict[_KT, _VT]):
__slots__ = ("inv",)
inv: OneToOne[_VT, _KT]
def clear(self) -> None: ...
def copy(self) -> Self: ...
@@ -87,6 +88,7 @@ def subdict(d: dict[_KT, _VT], keep: Iterable[_KT] | None = None, drop: Iterable
class FrozenHashError(TypeError): ... # undocumented
class FrozenDict(dict[_KT, _VT]):
__slots__ = ("_hash",)
def __copy__(self) -> Self: ...
@classmethod
def fromkeys(cls, keys: Iterable[_KT], value: _VT | None = None) -> Self: ... # type: ignore[override]
+1
View File
@@ -12,6 +12,7 @@ def floor(x: float, options: None = None) -> int: ...
def floor(x: float, options: Iterable[float]) -> float: ...
class Bits:
__slots__ = ("val", "len")
val: int
len: int
def __init__(self, val: int | list[bool] | str | bytes = 0, len_: int | None = None) -> None: ...
+1
View File
@@ -59,6 +59,7 @@ class IndexedSet(MutableSet[Any]):
def complement(wrapped: Iterable[Any]) -> _ComplementSet: ...
class _ComplementSet:
__slots__ = ("_included", "_excluded")
def __init__(
self, included: set[Any] | frozenset[Any] | None = None, excluded: set[Any] | frozenset[Any] | None = None
) -> None: ...
+1
View File
@@ -4,6 +4,7 @@ from typing import Any, Generic, Literal, TypeVar
from typing_extensions import Self
class Callpoint:
__slots__ = ("func_name", "lineno", "module_name", "module_path", "lasti", "line")
func_name: str
lineno: int
module_name: str