mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +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:
@@ -123,7 +123,7 @@ if sys.version_info >= (3, 8):
|
||||
@overload
|
||||
def __get__(self, instance: None, owner: Optional[Type[Any]] = ...) -> cached_property[_T]: ...
|
||||
@overload
|
||||
def __get__(self, instance: _S, owner: Optional[Type[Any]] = ...) -> _T: ...
|
||||
def __get__(self, instance: object, owner: Optional[Type[Any]] = ...) -> _T: ...
|
||||
def __set_name__(self, owner: Type[Any], name: str) -> None: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
Reference in New Issue
Block a user