diff --git a/stdlib/2.7/os/__init__.pyi b/stdlib/2.7/os/__init__.pyi index da49f10f1..7b754b764 100644 --- a/stdlib/2.7/os/__init__.pyi +++ b/stdlib/2.7/os/__init__.pyi @@ -1,6 +1,6 @@ # created from https://docs.python.org/2/library/os.html -from typing import List, Tuple, Union, Sequence, Mapping, IO, Any, Optional, AnyStr, MutableMapping +from typing import List, Tuple, Union, Sequence, Mapping, IO, Any, Optional, AnyStr, MutableMapping, Iterator import os.path as path error = OSError @@ -134,7 +134,10 @@ def rmdir(path: unicode) -> None: ... # TODO(MichalPokorny) def stat(path: unicode) -> Any: ... -# TODO: stat_float_times, statvfs, tempnam, tmpnam, TMP_MAX, walk +# TODO: stat_float_times, statvfs, tempnam, tmpnam, TMP_MAX +def walk(top: AnyStr, topdown: bool = ..., onerror: Any = ..., + followlinks: bool = ...) -> Iterator[Tuple[AnyStr, List[AnyStr], + List[AnyStr]]]: ... def symlink(source: unicode, link_name: unicode) -> None: ... def unlink(path: unicode) -> None: ... diff --git a/stdlib/3/os/__init__.pyi b/stdlib/3/os/__init__.pyi index 71e7cff85..dbdc9661a 100644 --- a/stdlib/3/os/__init__.pyi +++ b/stdlib/3/os/__init__.pyi @@ -267,13 +267,7 @@ def utime(path: AnyStr, times: Union[Tuple[int, int], Tuple[float, float]] = ... # TODO onerror: function from OSError to void def walk(top: AnyStr, topdown: bool = ..., onerror: Any = ..., followlinks: bool = ...) -> Iterator[Tuple[AnyStr, List[AnyStr], - List[AnyStr]]]: ... -# walk(): "By default errors from the os.listdir() call are ignored. If -# optional arg 'onerror' is specified, it should be a function; it -# will be called with one argument, an os.error instance. It can -# report the error to continue with the walk, or raise the exception -# to abort the walk. Note that the filename is available as the -# filename attribute of the exception object." + List[AnyStr]]]: ... def abort() -> 'None': ... def execl(path: AnyStr, arg0: AnyStr, *args: AnyStr) -> None: ...