From 6368baf42a4fcfe82f2bf2e40b6c0219e40d001e Mon Sep 17 00:00:00 2001 From: rchen152 Date: Thu, 6 Jul 2017 14:22:18 -0700 Subject: [PATCH] Remove duplicate names from posixpath.pyi. (#1468) posixpath.pyi did a '*' import of genericpath.pyi and then redefined everything it imported. Removes the duplicate definitions from posixpath and improves the ones in genericpath. --- stdlib/2/genericpath.pyi | 18 ++++++++++-------- stdlib/2/posixpath.pyi | 12 +----------- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/stdlib/2/genericpath.pyi b/stdlib/2/genericpath.pyi index 8def9a201..24bbbba3b 100644 --- a/stdlib/2/genericpath.pyi +++ b/stdlib/2/genericpath.pyi @@ -1,10 +1,12 @@ +from typing import AnyStr, List + class _unicode: ... -def exists(path): ... -def isfile(path): ... -def isdir(s): ... -def getsize(filename): ... -def getmtime(filename): ... -def getatime(filename): ... -def getctime(filename): ... -def commonprefix(m): ... +def commonprefix(list: List[AnyStr]) -> AnyStr: ... +def exists(path: unicode) -> bool: ... +def getatime(path: unicode) -> float: ... +def getmtime(path: unicode) -> float: ... +def getctime(path: unicode) -> float: ... +def getsize(path: unicode) -> int: ... +def isfile(path: unicode) -> bool: ... +def isdir(path: unicode) -> bool: ... diff --git a/stdlib/2/posixpath.pyi b/stdlib/2/posixpath.pyi index 7db5f673c..06a251c3d 100644 --- a/stdlib/2/posixpath.pyi +++ b/stdlib/2/posixpath.pyi @@ -1,4 +1,4 @@ -from typing import Any, AnyStr, List +from typing import Any from genericpath import * # noqa: F403 curdir = ... # type: Any @@ -34,13 +34,3 @@ def realpath(filename): ... supports_unicode_filenames = ... # type: Any def relpath(path, start=...): ... - -# posixpath imports these from genericpath.py: -def commonprefix(list: List[AnyStr]) -> AnyStr: ... -def exists(path: unicode) -> bool: ... -def getatime(path: unicode) -> float: ... -def getmtime(path: unicode) -> float: ... -def getctime(path: unicode) -> float: ... -def getsize(path: unicode) -> int: ... -def isfile(path: unicode) -> bool: ... -def isdir(path: unicode) -> bool: ...