mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-02 17:43:25 +08:00
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:
@@ -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]: ...
|
||||
|
||||
Reference in New Issue
Block a user