Skip to content
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
2 changes: 1 addition & 1 deletion stdlib/2/UserString.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class UserString(Sequence[UserString]):
def upper(self: _UST) -> _UST: ...
def zfill(self: _UST, width: int) -> _UST: ...

class MutableString(UserString, MutableSequence[MutableString]): # type: ignore
class MutableString(UserString, MutableSequence[MutableString]):
@overload
def __getitem__(self: _MST, i: int) -> _MST: ...
@overload
Expand Down
17 changes: 6 additions & 11 deletions stdlib/2/__builtin__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1160,20 +1160,15 @@ if sys.version_info >= (3,):
def filter(__function: Callable[[_T], Any], __iterable: Iterable[_T]) -> Iterator[_T]: ...
else:
@overload
def filter(__function: Callable[[AnyStr], Any], # type: ignore
__iterable: AnyStr) -> AnyStr: ...
def filter(__function: Callable[[AnyStr], Any], __iterable: AnyStr) -> AnyStr: ... # type: ignore
@overload
def filter(__function: None, # type: ignore
__iterable: Tuple[Optional[_T], ...]) -> Tuple[_T, ...]: ...
def filter(__function: None, __iterable: Tuple[Optional[_T], ...]) -> Tuple[_T, ...]: ... # type: ignore
@overload
def filter(__function: Callable[[_T], Any], # type: ignore
__iterable: Tuple[_T, ...]) -> Tuple[_T, ...]: ...
def filter(__function: Callable[[_T], Any], __iterable: Tuple[_T, ...]) -> Tuple[_T, ...]: ... # type: ignore
@overload
def filter(__function: None,
__iterable: Iterable[Optional[_T]]) -> List[_T]: ...
def filter(__function: None, __iterable: Iterable[Optional[_T]]) -> List[_T]: ...
@overload
def filter(__function: Callable[[_T], Any],
__iterable: Iterable[_T]) -> List[_T]: ...
def filter(__function: Callable[[_T], Any], __iterable: Iterable[_T]) -> List[_T]: ...
def format(__o: object, __format_spec: str = ...) -> str: ... # TODO unicode
def getattr(__o: Any, name: Text, __default: Any = ...) -> Any: ...
def globals() -> Dict[str, Any]: ...
Expand Down Expand Up @@ -1383,7 +1378,7 @@ if sys.version_info >= (3,):
@overload
def round(number: SupportsRound[_T]) -> int: ...
@overload
def round(number: SupportsRound[_T], ndigits: None) -> int: ... # type: ignore
def round(number: SupportsRound[_T], ndigits: None) -> int: ...
@overload
def round(number: SupportsRound[_T], ndigits: int) -> _T: ...
else:
Expand Down
17 changes: 6 additions & 11 deletions stdlib/2and3/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1160,20 +1160,15 @@ if sys.version_info >= (3,):
def filter(__function: Callable[[_T], Any], __iterable: Iterable[_T]) -> Iterator[_T]: ...
else:
@overload
def filter(__function: Callable[[AnyStr], Any], # type: ignore
__iterable: AnyStr) -> AnyStr: ...
def filter(__function: Callable[[AnyStr], Any], __iterable: AnyStr) -> AnyStr: ... # type: ignore
@overload
def filter(__function: None, # type: ignore
__iterable: Tuple[Optional[_T], ...]) -> Tuple[_T, ...]: ...
def filter(__function: None, __iterable: Tuple[Optional[_T], ...]) -> Tuple[_T, ...]: ... # type: ignore
@overload
def filter(__function: Callable[[_T], Any], # type: ignore
__iterable: Tuple[_T, ...]) -> Tuple[_T, ...]: ...
def filter(__function: Callable[[_T], Any], __iterable: Tuple[_T, ...]) -> Tuple[_T, ...]: ... # type: ignore
@overload
def filter(__function: None,
__iterable: Iterable[Optional[_T]]) -> List[_T]: ...
def filter(__function: None, __iterable: Iterable[Optional[_T]]) -> List[_T]: ...
@overload
def filter(__function: Callable[[_T], Any],
__iterable: Iterable[_T]) -> List[_T]: ...
def filter(__function: Callable[[_T], Any], __iterable: Iterable[_T]) -> List[_T]: ...
def format(__o: object, __format_spec: str = ...) -> str: ... # TODO unicode
def getattr(__o: Any, name: Text, __default: Any = ...) -> Any: ...
def globals() -> Dict[str, Any]: ...
Expand Down Expand Up @@ -1383,7 +1378,7 @@ if sys.version_info >= (3,):
@overload
def round(number: SupportsRound[_T]) -> int: ...
@overload
def round(number: SupportsRound[_T], ndigits: None) -> int: ... # type: ignore
def round(number: SupportsRound[_T], ndigits: None) -> int: ...
@overload
def round(number: SupportsRound[_T], ndigits: int) -> _T: ...
else:
Expand Down
2 changes: 1 addition & 1 deletion stdlib/3/configparser.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class RawConfigParser(_parser):
@overload # type: ignore
def get(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ...) -> str: ...

@overload # type: ignore
@overload
def get(self, section: str, option: str, *, raw: bool = ..., vars: Optional[_section] = ..., fallback: _T) -> Union[str, _T]: ...

@overload
Expand Down
4 changes: 1 addition & 3 deletions stdlib/3/enum.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ if sys.version_info >= (3, 6):
def __xor__(self: _T, other: _T) -> _T: ...
def __invert__(self: _T) -> _T: ...

# The `type: ignore` comment is needed because mypy considers the type
# signatures of several methods defined in int and Flag to be incompatible.
class IntFlag(int, Flag): # type: ignore
class IntFlag(int, Flag):
def __or__(self: _T, other: Union[int, _T]) -> _T: ...
def __and__(self: _T, other: Union[int, _T]) -> _T: ...
def __xor__(self: _T, other: Union[int, _T]) -> _T: ...
Expand Down
8 changes: 4 additions & 4 deletions stdlib/3/multiprocessing/context.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,19 @@ class DefaultContext(object):

if sys.platform != 'win32':
# TODO: type should be BaseProcess once a stub in multiprocessing.process exists
class ForkProcess(Any): # type: ignore
class ForkProcess(Any):
_start_method: str
@staticmethod
def _Popen(process_obj: Any) -> Any: ...

# TODO: type should be BaseProcess once a stub in multiprocessing.process exists
class SpawnProcess(Any): # type: ignore
class SpawnProcess(Any):
_start_method: str
@staticmethod
def _Popen(process_obj: Any) -> SpawnProcess: ...

# TODO: type should be BaseProcess once a stub in multiprocessing.process exists
class ForkServerProcess(Any): # type: ignore
class ForkServerProcess(Any):
_start_method: str
@staticmethod
def _Popen(process_obj: Any) -> Any: ...
Expand All @@ -161,7 +161,7 @@ if sys.platform != 'win32':
Process: Type[ForkServerProcess]
else:
# TODO: type should be BaseProcess once a stub in multiprocessing.process exists
class SpawnProcess(Any): # type: ignore
class SpawnProcess(Any):
_start_method: str
@staticmethod
# TODO: type should be BaseProcess once a stub in multiprocessing.process exists
Expand Down
4 changes: 1 addition & 3 deletions third_party/2/enum.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ if sys.version_info >= (3, 6):
def __xor__(self: _T, other: _T) -> _T: ...
def __invert__(self: _T) -> _T: ...

# The `type: ignore` comment is needed because mypy considers the type
# signatures of several methods defined in int and Flag to be incompatible.
class IntFlag(int, Flag): # type: ignore
class IntFlag(int, Flag):
def __or__(self: _T, other: Union[int, _T]) -> _T: ...
def __and__(self: _T, other: Union[int, _T]) -> _T: ...
def __xor__(self: _T, other: Union[int, _T]) -> _T: ...
Expand Down