mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-08-01 21:50:21 +08:00
Add __slots__ to third-party packages using stubdefaulter (#14619)
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user