mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Remove many redundant inheritances from Generic[] (#10933)
This commit is contained in:
@@ -45,7 +45,7 @@ def namedtuple(
|
||||
defaults: Iterable[Any] | None = None,
|
||||
) -> type[tuple[Any, ...]]: ...
|
||||
|
||||
class UserDict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
class UserDict(MutableMapping[_KT, _VT]):
|
||||
data: dict[_KT, _VT]
|
||||
# __init__ should be kept roughly in line with `dict.__init__`, which has the same semantics
|
||||
@overload
|
||||
@@ -228,7 +228,7 @@ class UserString(Sequence[UserString]):
|
||||
def upper(self) -> Self: ...
|
||||
def zfill(self, width: int) -> Self: ...
|
||||
|
||||
class deque(MutableSequence[_T], Generic[_T]):
|
||||
class deque(MutableSequence[_T]):
|
||||
@property
|
||||
def maxlen(self) -> int | None: ...
|
||||
@overload
|
||||
@@ -383,7 +383,7 @@ class OrderedDict(dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
|
||||
@overload
|
||||
def __ror__(self, __value: dict[_T1, _T2]) -> OrderedDict[_KT | _T1, _VT | _T2]: ... # type: ignore[misc]
|
||||
|
||||
class defaultdict(dict[_KT, _VT], Generic[_KT, _VT]):
|
||||
class defaultdict(dict[_KT, _VT]):
|
||||
default_factory: Callable[[], _VT] | None
|
||||
@overload
|
||||
def __init__(self) -> None: ...
|
||||
@@ -424,7 +424,7 @@ class defaultdict(dict[_KT, _VT], Generic[_KT, _VT]):
|
||||
@overload
|
||||
def __ror__(self, __value: dict[_T1, _T2]) -> defaultdict[_KT | _T1, _VT | _T2]: ... # type: ignore[misc]
|
||||
|
||||
class ChainMap(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
class ChainMap(MutableMapping[_KT, _VT]):
|
||||
maps: list[MutableMapping[_KT, _VT]]
|
||||
def __init__(self, *maps: MutableMapping[_KT, _VT]) -> None: ...
|
||||
def new_child(self, m: MutableMapping[_KT, _VT] | None = None) -> Self: ...
|
||||
|
||||
Reference in New Issue
Block a user