keep os.path in 2 and 3 consistent (#2152)

We can't merge these because os/__init__ is still different.

Also slight refactor of tests/check_consistent.py to avoid `from os import path`.
This commit is contained in:
Jelle Zijlstra
2018-05-22 07:14:13 -07:00
committed by Guido van Rossum
parent d84069e78d
commit b89f9553e9
3 changed files with 13 additions and 10 deletions

View File

@@ -1,3 +1,4 @@
# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent!
# Stubs for os.path
# Ron Murawski <ron@horizonchess.com>

View File

@@ -1,3 +1,4 @@
# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent!
# Stubs for os.path
# Ron Murawski <ron@horizonchess.com>
@@ -123,13 +124,13 @@ if sys.version_info < (3, 0):
@overload
def join(__p1: bytes, *p: bytes) -> bytes: ...
@overload
def join(__p1: Text, *p: _PathType) -> Text: ...
@overload
def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ...
def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ...
@overload
def join(__p1: bytes, __p2: bytes, __p3: Text, *p: _PathType) -> Text: ...
@overload
def join(__p1: bytes, __p2: bytes, __p3: bytes, __p4: Text, *p: _PathType) -> Text: ...
def join(__p1: bytes, __p2: Text, *p: _PathType) -> Text: ...
@overload
def join(__p1: Text, *p: _PathType) -> Text: ...
elif sys.version_info >= (3, 6):
# Mypy complains that the signatures overlap (same for relpath below), but things seem to behave correctly anyway.
@overload