mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +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:
@@ -13,7 +13,7 @@ _S = TypeVar("_S", bound=Type[Enum])
|
||||
class EnumMeta(ABCMeta):
|
||||
def __iter__(self: Type[_T]) -> Iterator[_T]: ...
|
||||
def __reversed__(self: Type[_T]) -> Iterator[_T]: ...
|
||||
def __contains__(self: Type[_T], member: object) -> bool: ...
|
||||
def __contains__(self, member: object) -> bool: ...
|
||||
def __getitem__(self: Type[_T], name: str) -> _T: ...
|
||||
@property
|
||||
def __members__(self: Type[_T]) -> Mapping[str, _T]: ...
|
||||
|
||||
Reference in New Issue
Block a user