mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-24 04:41:30 +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:
@@ -61,14 +61,14 @@ def get_function_closure(fun: types.FunctionType) -> Optional[Tuple[types._Cell,
|
||||
def get_function_code(fun: types.FunctionType) -> types.CodeType: ...
|
||||
def get_function_defaults(fun: types.FunctionType) -> Optional[Tuple[Any, ...]]: ...
|
||||
def get_function_globals(fun: types.FunctionType) -> Dict[str, Any]: ...
|
||||
def iterkeys(d: Mapping[_K, _V]) -> typing.Iterator[_K]: ...
|
||||
def itervalues(d: Mapping[_K, _V]) -> typing.Iterator[_V]: ...
|
||||
def iterkeys(d: Mapping[_K, Any]) -> typing.Iterator[_K]: ...
|
||||
def itervalues(d: Mapping[Any, _V]) -> typing.Iterator[_V]: ...
|
||||
def iteritems(d: Mapping[_K, _V]) -> typing.Iterator[Tuple[_K, _V]]: ...
|
||||
|
||||
# def iterlists
|
||||
|
||||
def viewkeys(d: Mapping[_K, _V]) -> KeysView[_K]: ...
|
||||
def viewvalues(d: Mapping[_K, _V]) -> ValuesView[_V]: ...
|
||||
def viewkeys(d: Mapping[_K, Any]) -> KeysView[_K]: ...
|
||||
def viewvalues(d: Mapping[Any, _V]) -> ValuesView[_V]: ...
|
||||
def viewitems(d: Mapping[_K, _V]) -> ItemsView[_K, _V]: ...
|
||||
def b(s: str) -> binary_type: ...
|
||||
def u(s: str) -> text_type: ...
|
||||
|
||||
Reference in New Issue
Block a user