Make viewkeys, viewitems, viewvalues use proper types now that the typing backport has them (#602)

This commit is contained in:
Calen Pennington
2016-10-14 11:41:29 -04:00
committed by Guido van Rossum
parent 1b9266d801
commit 5daf552f5b

View File

@@ -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: ...