mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
Make viewkeys, viewitems, viewvalues use proper types now that the typing backport has them (#602)
This commit is contained in:
committed by
Guido van Rossum
parent
1b9266d801
commit
5daf552f5b
9
third_party/2.7/six/__init__.pyi
vendored
9
third_party/2.7/six/__init__.pyi
vendored
@@ -4,7 +4,7 @@ from __future__ import print_function
|
||||
|
||||
from typing import (
|
||||
Any, AnyStr, Callable, Iterable, Mapping, Optional,
|
||||
Pattern, Tuple, TypeVar, Union, overload,
|
||||
Pattern, Tuple, TypeVar, Union, overload, ValuesView, KeysView, ItemsView
|
||||
)
|
||||
import typing
|
||||
|
||||
@@ -56,10 +56,9 @@ def itervalues(d: Mapping[_K, _V]) -> typing.Iterator[_V]: ...
|
||||
def iteritems(d: Mapping[_K, _V]) -> typing.Iterator[Tuple[_K, _V]]: ...
|
||||
#def iterlists
|
||||
|
||||
# TODO fix return types - python2 typing doesn't include KeysView etc yet.
|
||||
def viewkeys(d: Mapping[_K, _V]) -> Iterable[_K]: ...
|
||||
def viewvalues(d: Mapping[_K, _V]) -> Iterable[_V]: ...
|
||||
def viewitems(d: Mapping[_K, _V]) -> Iterable[Tuple[_K, _V]]: ...
|
||||
def viewkeys(d: Mapping[_K, _V]) -> KeysView[_K]: ...
|
||||
def viewvalues(d: Mapping[_K, _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