Fix abstract classes for Python 3 (#2239)

* add metaclass=ABCMeta to some classes

* mark some more classes as explicitly abstract

* make some more classes concrete
This commit is contained in:
Jelle Zijlstra
2018-06-16 10:18:54 -07:00
committed by GitHub
parent 341fa375ef
commit 94ab32ba59
10 changed files with 32 additions and 15 deletions

View File

@@ -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):
@@ -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]: ...
@@ -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]: ...