Skip to content

Fix non-subscriptable type aliases #993

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions stdlib/2/ConfigParser.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Any, IO, Sequence, Tuple, Union
from typing import Any, IO, Sequence, Tuple, Union, List, Dict

__all__ = ... # type: list[str]
__all__ = ... # type: List[str]
DEFAULTSECT = ... # type: str
MAX_INTERPOLATION_DEPTH = ... # type: int

Expand Down Expand Up @@ -42,7 +42,7 @@ class InterpolationDepthError(InterpolationError):

class ParsingError(Error):
filename = ... # type: str
errors = ... # type: list[Tuple[Any, Any]]
errors = ... # type: List[Tuple[Any, Any]]
def __init__(self, filename: str) -> None: ...
def append(self, lineno: Any, line: Any) -> None: ...

Expand All @@ -60,20 +60,20 @@ class RawConfigParser:
SECTCRE = ... # type: Any
OPTCRE = ... # type: Any
OPTCRE_NV = ... # type: Any
def __init__(self, defaults: dict[Any, Any] = ..., dict_type: Any = ..., allow_no_value: bool = ...) -> None: ...
def defaults(self) -> dict[Any, Any]: ...
def sections(self) -> list[str]: ...
def __init__(self, defaults: Dict[Any, Any] = ..., dict_type: Any = ..., allow_no_value: bool = ...) -> None: ...
def defaults(self) -> Dict[Any, Any]: ...
def sections(self) -> List[str]: ...
def add_section(self, section: str) -> None: ...
def has_section(self, section: str) -> bool: ...
def options(self, section: str) -> list[str]: ...
def read(self, filenames: Union[str, Sequence[str]]) -> list[str]: ...
def options(self, section: str) -> List[str]: ...
def read(self, filenames: Union[str, Sequence[str]]) -> List[str]: ...
def readfp(self, fp: IO[str], filename: str = ...) -> None: ...
def get(self, section: str, option: str) -> str: ...
def items(self, section: str) -> list[Tuple[Any, Any]]: ...
def items(self, section: str) -> List[Tuple[Any, Any]]: ...
def _get(self, section: str, conv: type, option: str) -> Any: ...
def getint(self, section: str, option: str) -> int: ...
def getfloat(self, section: str, option: str) -> float: ...
_boolean_states = ... # type: dict[str, bool]
_boolean_states = ... # type: Dict[str, bool]
def getboolean(self, section: str, option: str) -> bool: ...
def optionxform(self, optionstr: str) -> str: ...
def has_option(self, section: str, option: str) -> bool: ...
Expand All @@ -86,7 +86,7 @@ class RawConfigParser:
class ConfigParser(RawConfigParser):
_KEYCRE = ... # type: Any
def get(self, section: str, option: str, raw: bool = ..., vars: dict = ...) -> Any: ...
def items(self, section: str, raw: bool = ..., vars: dict = ...) -> list[Tuple[str, Any]]: ...
def items(self, section: str, raw: bool = ..., vars: dict = ...) -> List[Tuple[str, Any]]: ...
def _interpolate(self, section: str, option: str, rawval: Any, vars: Any) -> str: ...
def _interpolation_replace(self, match: Any) -> str: ...

Expand Down
26 changes: 13 additions & 13 deletions stdlib/2/__builtin__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -586,33 +586,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: ...
Expand Down
26 changes: 13 additions & 13 deletions stdlib/3/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down
25 changes: 13 additions & 12 deletions stdlib/3/collections/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]: ...
Expand Down Expand Up @@ -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: ...
Expand Down