From 5daf552f5bd47a7a5eaf8b05d350763b9a76990e Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Fri, 14 Oct 2016 11:41:29 -0400 Subject: [PATCH] Make viewkeys, viewitems, viewvalues use proper types now that the typing backport has them (#602) --- third_party/2.7/six/__init__.pyi | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/third_party/2.7/six/__init__.pyi b/third_party/2.7/six/__init__.pyi index 5f5383bbc..aadf05660 100644 --- a/third_party/2.7/six/__init__.pyi +++ b/third_party/2.7/six/__init__.pyi @@ -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: ...