Add Text to typing.pyi; it's an alias for unicode in 2.7, for str in 3.

This commit is contained in:
Guido van Rossum
2016-04-16 13:42:17 -07:00
parent 70c2274e94
commit 78e6e9b740
2 changed files with 6 additions and 0 deletions

View File

@@ -181,6 +181,8 @@ class MutableMapping(Mapping[_KT, _VT], Generic[_KT, _VT]):
def update(self, m: Union[Mapping[_KT, _VT],
Iterable[Tuple[_KT, _VT]]]) -> None: ...
Text = unicode
class IO(Iterable[AnyStr], Generic[AnyStr]):
# TODO detach
# TODO use abstract properties

View File

@@ -212,6 +212,8 @@ class ValuesView(MappingView, Iterable[_VT_co], Generic[_VT_co]):
def __contains__(self, o: object) -> bool: ...
def __iter__(self) -> Iterator[_VT_co]: ...
# TODO: ContextManager (only if contextlib.AbstractContextManager exists)
class Mapping(Iterable[_KT], Container[_KT], Sized, Generic[_KT, _VT]):
# TODO: Value type should be covariant, but currently we can't give a good signature for
# get if this is the case.
@@ -237,6 +239,8 @@ class MutableMapping(Mapping[_KT, _VT], Generic[_KT, _VT]):
def update(self, m: Union[Mapping[_KT, _VT],
Iterable[Tuple[_KT, _VT]]]) -> None: ...
Text = str
class IO(Iterable[AnyStr], Generic[AnyStr]):
# TODO detach
# TODO use abstract properties