Fix non-subscriptable type aliases (#993)

This commit is contained in:
Ivan Levkivskyi
2017-03-14 01:24:34 +01:00
committed by Guido van Rossum
parent 52da2a176b
commit b430318ac0
4 changed files with 50 additions and 49 deletions

View File

@@ -636,33 +636,33 @@ class set(MutableSet[_T], Generic[_T]):
def __init__(self, iterable: Iterable[_T] = ...) -> None: ...
def add(self, element: _T) -> None: ...
def clear(self) -> None: ...
def copy(self) -> set[_T]: ...
def difference(self, *s: Iterable[Any]) -> set[_T]: ...
def copy(self) -> Set[_T]: ...
def difference(self, *s: Iterable[Any]) -> Set[_T]: ...
def difference_update(self, *s: Iterable[Any]) -> None: ...
def discard(self, element: _T) -> None: ...
def intersection(self, *s: Iterable[Any]) -> set[_T]: ...
def intersection(self, *s: Iterable[Any]) -> Set[_T]: ...
def intersection_update(self, *s: Iterable[Any]) -> None: ...
def isdisjoint(self, s: Iterable[Any]) -> bool: ...
def issubset(self, s: Iterable[Any]) -> bool: ...
def issuperset(self, s: Iterable[Any]) -> bool: ...
def pop(self) -> _T: ...
def remove(self, element: _T) -> None: ...
def symmetric_difference(self, s: Iterable[_T]) -> set[_T]: ...
def symmetric_difference(self, s: Iterable[_T]) -> Set[_T]: ...
def symmetric_difference_update(self, s: Iterable[_T]) -> None: ...
def union(self, *s: Iterable[_T]) -> set[_T]: ...
def union(self, *s: Iterable[_T]) -> Set[_T]: ...
def update(self, *s: Iterable[_T]) -> None: ...
def __len__(self) -> int: ...
def __contains__(self, o: object) -> bool: ...
def __iter__(self) -> Iterator[_T]: ...
def __str__(self) -> str: ...
def __and__(self, s: AbstractSet[Any]) -> set[_T]: ...
def __iand__(self, s: AbstractSet[Any]) -> set[_T]: ...
def __or__(self, s: AbstractSet[_S]) -> set[Union[_T, _S]]: ...
def __ior__(self, s: AbstractSet[_S]) -> set[Union[_T, _S]]: ...
def __sub__(self, s: AbstractSet[Any]) -> set[_T]: ...
def __isub__(self, s: AbstractSet[Any]) -> set[_T]: ...
def __xor__(self, s: AbstractSet[_S]) -> set[Union[_T, _S]]: ...
def __ixor__(self, s: AbstractSet[_S]) -> set[Union[_T, _S]]: ...
def __and__(self, s: AbstractSet[Any]) -> Set[_T]: ...
def __iand__(self, s: AbstractSet[Any]) -> Set[_T]: ...
def __or__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ...
def __ior__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ...
def __sub__(self, s: AbstractSet[Any]) -> Set[_T]: ...
def __isub__(self, s: AbstractSet[Any]) -> Set[_T]: ...
def __xor__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ...
def __ixor__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ...
def __le__(self, s: AbstractSet[Any]) -> bool: ...
def __lt__(self, s: AbstractSet[Any]) -> bool: ...
def __ge__(self, s: AbstractSet[Any]) -> bool: ...

View File

@@ -6,6 +6,7 @@
# These are not exported.
import sys
import typing
from typing import (
TypeVar, Generic, Dict, overload, List, Tuple,
Callable, Any, Type, Optional, Union
@@ -128,16 +129,16 @@ class Counter(Dict[_T, int], Generic[_T]):
@overload
def update(self, m: Union[Iterable[_T], Iterable[Tuple[_T, int]]]) -> None: ...
def __add__(self, other: Counter[_T]) -> Counter[_T]: ...
def __sub__(self, other: Counter[_T]) -> Counter[_T]: ...
def __and__(self, other: Counter[_T]) -> Counter[_T]: ...
def __or__(self, other: Counter[_T]) -> Counter[_T]: ...
def __pos__(self) -> Counter[_T]: ...
def __neg__(self) -> Counter[_T]: ...
def __iadd__(self, other: Counter[_T]) -> Counter[_T]: ...
def __isub__(self, other: Counter[_T]) -> Counter[_T]: ...
def __iand__(self, other: Counter[_T]) -> Counter[_T]: ...
def __ior__(self, other: Counter[_T]) -> Counter[_T]: ...
def __add__(self, other: typing.Counter[_T]) -> typing.Counter[_T]: ...
def __sub__(self, other: typing.Counter[_T]) -> typing.Counter[_T]: ...
def __and__(self, other: typing.Counter[_T]) -> typing.Counter[_T]: ...
def __or__(self, other: typing.Counter[_T]) -> typing.Counter[_T]: ...
def __pos__(self) -> typing.Counter[_T]: ...
def __neg__(self) -> typing.Counter[_T]: ...
def __iadd__(self, other: typing.Counter[_T]) -> typing.Counter[_T]: ...
def __isub__(self, other: typing.Counter[_T]) -> typing.Counter[_T]: ...
def __iand__(self, other: typing.Counter[_T]) -> typing.Counter[_T]: ...
def __ior__(self, other: typing.Counter[_T]) -> typing.Counter[_T]: ...
class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
def popitem(self, last: bool = ...) -> Tuple[_KT, _VT]: ...
@@ -176,10 +177,10 @@ if sys.version_info >= (3, 3):
@property
def maps(self) -> List[Mapping[_KT, _VT]]: ...
def new_child(self, m: Mapping[_KT, _VT] = ...) -> ChainMap[_KT, _VT]: ...
def new_child(self, m: Mapping[_KT, _VT] = ...) -> typing.ChainMap[_KT, _VT]: ...
@property
def parents(self) -> ChainMap[_KT, _VT]: ...
def parents(self) -> typing.ChainMap[_KT, _VT]: ...
def __setitem__(self, k: _KT, v: _VT) -> None: ...
def __delitem__(self, v: _KT) -> None: ...