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:
Jukka Lehtosalo
2016-04-28 11:53:51 +01:00
parent fde085bbdd
commit a5d5dcc4f4
2 changed files with 9 additions and 3 deletions

View File

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

View File

@@ -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]