mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Eliminated the use of "bare" TypeVars in stdlib stubs (#5041)
Eliminated the use of "bare" TypeVars (i.e. a TypeVar that appears only once) within generic methods. While not considered an error in PEP 484, these are a common source of bugs in code, and some type checkers (including pytype and pyright) flag them as errors. Co-authored-by: Eric Traut <erictr@microsoft.com>
This commit is contained in:
@@ -23,7 +23,7 @@ class WeakSet(MutableSet[_T], Generic[_T]):
|
||||
def __ior__(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ...
|
||||
def difference(self: _SelfT, other: Iterable[_T]) -> _SelfT: ...
|
||||
def __sub__(self: _SelfT, other: Iterable[_T]) -> _SelfT: ...
|
||||
def difference_update(self: _SelfT, other: Iterable[_T]) -> None: ...
|
||||
def difference_update(self, other: Iterable[_T]) -> None: ...
|
||||
def __isub__(self: _SelfT, other: Iterable[_T]) -> _SelfT: ...
|
||||
def intersection(self: _SelfT, other: Iterable[_T]) -> _SelfT: ...
|
||||
def __and__(self: _SelfT, other: Iterable[_T]) -> _SelfT: ...
|
||||
@@ -38,7 +38,7 @@ class WeakSet(MutableSet[_T], Generic[_T]):
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def symmetric_difference(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ...
|
||||
def __xor__(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ...
|
||||
def symmetric_difference_update(self, other: Iterable[_S]) -> None: ...
|
||||
def symmetric_difference_update(self, other: Iterable[Any]) -> None: ...
|
||||
def __ixor__(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ...
|
||||
def union(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ...
|
||||
def __or__(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ...
|
||||
|
||||
Reference in New Issue
Block a user