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
1 change: 1 addition & 0 deletions stdlib/2and3/_csv.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Dialect:
class _reader(Iterator[List[str]]):
dialect = ... # type: Dialect
line_num = ... # type: int
def __next__(self) -> List[str]: ...

class _writer:
dialect = ... # type: Dialect
Expand Down
2 changes: 1 addition & 1 deletion stdlib/3.4/asyncio/events.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class AbstractEventLoopPolicy(metaclass=ABCMeta):
@abstractmethod
def set_child_watcher(self, watcher: Any) -> None: ... # TODO: unix_events.AbstractChildWatcher

class BaseDefaultEventLoopPolicy(AbstractEventLoopPolicy):
class BaseDefaultEventLoopPolicy(AbstractEventLoopPolicy, metaclass=ABCMeta):
def __init__(self) -> None: ...
def get_event_loop(self) -> AbstractEventLoop: ...
def set_event_loop(self, loop: AbstractEventLoop) -> None: ...
Expand Down
2 changes: 1 addition & 1 deletion stdlib/3.7/contextvars.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ class Context(Mapping[ContextVar[Any], Any]):
def copy(self) -> Context: ...
def __getitem__(self, key: ContextVar[Any]) -> Any: ...
def __iter__(self) -> Iterator[ContextVar[Any]]: ...
def __len___(self) -> int: ...
def __len__(self) -> int: ...
9 changes: 6 additions & 3 deletions stdlib/3/collections/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,12 @@ class Counter(Dict[_T, int], Generic[_T]):

_OrderedDictT = TypeVar('_OrderedDictT', bound=OrderedDict)

class _OrderedDictKeysView(KeysView[_KT], Reversible[_KT]): ...
class _OrderedDictItemsView(ItemsView[_KT, _VT], Reversible[Tuple[_KT, _VT]]): ...
class _OrderedDictValuesView(ValuesView[_VT], Reversible[_VT]): ...
class _OrderedDictKeysView(KeysView[_KT], Reversible[_KT]):
def __reversed__(self) -> Iterator[_KT]: ...
class _OrderedDictItemsView(ItemsView[_KT, _VT], Reversible[Tuple[_KT, _VT]]):
def __reversed__(self) -> Iterator[Tuple[_KT, _VT]]: ...
class _OrderedDictValuesView(ValuesView[_VT], Reversible[_VT]):
def __reversed__(self) -> Iterator[_VT]: ...

class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
def popitem(self, last: bool = ...) -> Tuple[_KT, _VT]: ...
Expand Down
4 changes: 2 additions & 2 deletions stdlib/3/importlib/abc.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ExecutionLoader(InspectLoader):
def get_filename(self, fullname: str) -> _Path: ...
def get_code(self, fullname: str) -> Optional[types.CodeType]: ...

class SourceLoader(ResourceLoader, ExecutionLoader):
class SourceLoader(ResourceLoader, ExecutionLoader, metaclass=ABCMeta):
def path_mtime(self, path: _Path) -> Union[int, float]: ...
def set_data(self, path: _Path, data: bytes) -> None: ...
def get_source(self, fullname: str) -> Optional[str]: ...
Expand Down Expand Up @@ -82,7 +82,7 @@ if sys.version_info >= (3, 3):
target: Optional[types.ModuleType] = ...
) -> Optional[ModuleSpec]: ...

class FileLoader(ResourceLoader, ExecutionLoader):
class FileLoader(ResourceLoader, ExecutionLoader, metaclass=ABCMeta):
name = ... # type: str
path = ... # type: _Path
def __init__(self, fullname: str, path: _Path) -> None: ...
Expand Down
7 changes: 7 additions & 0 deletions stdlib/3/os/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ X_OK: int

class _Environ(MutableMapping[AnyStr, AnyStr], Generic[AnyStr]):
def copy(self) -> Dict[AnyStr, AnyStr]: ...
def __delitem__(self, key: AnyStr) -> None: ...
def __getitem__(self, key: AnyStr) -> AnyStr: ...
def __setitem__(self, key: AnyStr, value: AnyStr) -> None: ...
def __iter__(self) -> Iterator[AnyStr]: ...
def __len__(self) -> int: ...

environ: _Environ[str]
if sys.version_info >= (3, 2):
Expand Down Expand Up @@ -456,6 +461,7 @@ else:
def rmdir(path: _PathType) -> None: ...
if sys.version_info >= (3, 7):
class _ScandirIterator(Iterator[DirEntry[AnyStr]], ContextManager[_ScandirIterator[AnyStr]]):
def __next__(self) -> DirEntry[AnyStr]: ...
def close(self) -> None: ...
@overload
def scandir() -> _ScandirIterator[str]: ...
Expand All @@ -465,6 +471,7 @@ if sys.version_info >= (3, 7):
def scandir(path: Union[AnyStr, PathLike[AnyStr]]) -> _ScandirIterator[AnyStr]: ...
elif sys.version_info >= (3, 6):
class _ScandirIterator(Iterator[DirEntry[AnyStr]], ContextManager[_ScandirIterator[AnyStr]]):
def __next__(self) -> DirEntry[AnyStr]: ...
def close(self) -> None: ...
@overload
def scandir() -> _ScandirIterator[str]: ...
Expand Down
4 changes: 2 additions & 2 deletions stdlib/3/typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class Coroutine(Awaitable[_V_co], Generic[_T_co, _T_contra, _V_co]):
# NOTE: This type does not exist in typing.py or PEP 484.
# The parameters corrrespond to Generator, but the 4th is the original type.
class AwaitableGenerator(Awaitable[_V_co], Generator[_T_co, _T_contra, _V_co],
Generic[_T_co, _T_contra, _V_co, _S]):
Generic[_T_co, _T_contra, _V_co, _S], metaclass=ABCMeta):
pass

@runtime
Expand Down Expand Up @@ -457,7 +457,7 @@ class TextIO(IO[str]):
@abstractmethod
def __enter__(self) -> TextIO: ...

class ByteString(Sequence[int]): ...
class ByteString(Sequence[int], metaclass=ABCMeta): ...

class Match(Generic[AnyStr]):
pos = 0
Expand Down
8 changes: 6 additions & 2 deletions third_party/2and3/google/protobuf/internal/containers.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@ from google.protobuf.internal.message_listener import MessageListener
from google.protobuf.message import Message
from typing import (
MutableSequence, Sequence, TypeVar, Generic, Any, Iterator, Iterable,
Union, Optional, Callable
Union, Optional, Callable, overload, List
)

_T = TypeVar('_T')
class BaseContainer(Generic[_T], MutableSequence[_T]):
class BaseContainer(Sequence[_T]):
def __init__(self, message_listener: MessageListener) -> None: ...
def __len__(self) -> int: ...
def __ne__(self, other: object) -> bool: ...
def __hash__(self) -> int: ...
def __repr__(self) -> str: ...
def sort(self, *, key: Optional[Callable[[_T], Any]] = ..., reverse: bool = ...) -> None: ...
@overload
def __getitem__(self, key: int) -> _T: ...
@overload
def __getitem__(self, key: slice) -> List[_T]: ...

class RepeatedScalarFieldContainer(Generic[_T], BaseContainer[_T]):
def __init__(self, message_listener: MessageListener, message_descriptor: Descriptor) -> None: ...
Expand Down
5 changes: 3 additions & 2 deletions third_party/2and3/requests/packages/urllib3/response.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Any, IO
from typing import Any
import io
from . import _collections
from . import exceptions
from .connection import HTTPException as HTTPException, BaseSSLError as BaseSSLError
Expand All @@ -22,7 +23,7 @@ class GzipDecoder:
def __getattr__(self, name): ...
def decompress(self, data): ...

class HTTPResponse(IO[Any]):
class HTTPResponse(io.IOBase):
CONTENT_DECODERS = ... # type: Any
REDIRECT_STATUSES = ... # type: Any
headers = ... # type: Any
Expand Down
5 changes: 3 additions & 2 deletions third_party/3/pkg_resources.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ from typing import (
List, Union,
TypeVar, overload,
)
from abc import ABCMeta
import importlib.abc
import sys
import types
Expand Down Expand Up @@ -248,9 +249,9 @@ class ExtractionError(Exception):


if sys.version_info >= (3, 3):
class _Importer(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader): ...
class _Importer(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader, metaclass=ABCMeta): ...
else:
class _Importer(importlib.abc.InspectLoader): ...
class _Importer(importlib.abc.InspectLoader, metaclass=ABCMeta): ...

def register_finder(importer_type: type,
distribution_finder: _DistFinderType) -> None: ...
Expand Down