From 364867f039b610911e66003863e0c69dc0d6b909 Mon Sep 17 00:00:00 2001 From: Sid Kapur Date: Mon, 12 Mar 2018 19:20:16 -0500 Subject: [PATCH 1/2] abspath and basename should accept _PathType --- stdlib/3/os/path.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/3/os/path.pyi b/stdlib/3/os/path.pyi index 993d3aa1aaf0..fdc28f980b39 100644 --- a/stdlib/3/os/path.pyi +++ b/stdlib/3/os/path.pyi @@ -30,8 +30,8 @@ defpath = ... # type: str devnull = ... # type: str # ----- os.path function stubs ----- -def abspath(path: AnyStr) -> AnyStr: ... -def basename(path: AnyStr) -> AnyStr: ... +def abspath(path: _PathType) -> AnyStr: ... +def basename(path: _PathType) -> AnyStr: ... if sys.version_info >= (3, 5): def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ... From 710f3101d176999a44dc0e9d49e7b0d0430fabe6 Mon Sep 17 00:00:00 2001 From: Sid Kapur Date: Mon, 12 Mar 2018 21:41:42 -0500 Subject: [PATCH 2/2] Join should also take PathType --- stdlib/3/os/path.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/3/os/path.pyi b/stdlib/3/os/path.pyi index fdc28f980b39..a574a990ebbc 100644 --- a/stdlib/3/os/path.pyi +++ b/stdlib/3/os/path.pyi @@ -76,7 +76,7 @@ if sys.version_info < (3, 0): @overload def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ... else: - def join(path: AnyStr, *paths: AnyStr) -> AnyStr: ... + def join(path: _PathType, *paths: _PathType) -> AnyStr: ... def normcase(path: AnyStr) -> AnyStr: ... def normpath(path: AnyStr) -> AnyStr: ...