mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Fixes to os.environ (#172)
Add os.environ.copy() to Python 2 stubs. Fix return type of os.environ.copy().
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
# created from https://docs.python.org/2/library/os.html
|
||||
|
||||
from typing import List, Tuple, Union, Sequence, Mapping, IO, Any, Optional, AnyStr, MutableMapping, Iterator
|
||||
from typing import (
|
||||
List, Tuple, Union, Sequence, Mapping, IO, Any, Optional, AnyStr, Iterator, MutableMapping
|
||||
)
|
||||
import os.path as path
|
||||
|
||||
error = OSError
|
||||
name = ... # type: str
|
||||
environ = ... # type: MutableMapping[str, str]
|
||||
|
||||
class _Environ(MutableMapping[str, str]):
|
||||
def copy(self) -> Dict[str, str]: ...
|
||||
|
||||
environ = ... # type: _Environ
|
||||
|
||||
def chdir(path: unicode) -> None: ...
|
||||
def fchdir(fd: int) -> None: ...
|
||||
|
||||
@@ -62,7 +62,7 @@ W_OK = 0
|
||||
X_OK = 0
|
||||
|
||||
class _Environ(MutableMapping[AnyStr, AnyStr], Generic[AnyStr]):
|
||||
def copy(self) -> _Environ[AnyStr]: ...
|
||||
def copy(self) -> Dict[AnyStr, AnyStr]: ...
|
||||
|
||||
environ = ... # type: _Environ[str]
|
||||
environb = ... # type: _Environ[bytes]
|
||||
|
||||
Reference in New Issue
Block a user