mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 20:24:30 +08:00
Add stub for os.path.commonpath (new in 3.5). (#738)
* Add stub for os.path.commonpath (new in 3.5).
This commit is contained in:
committed by
Jukka Lehtosalo
parent
dccc29bc2f
commit
e7db9cda4d
@@ -3,7 +3,8 @@
|
||||
|
||||
# based on http://docs.python.org/3.2/library/os.path.html
|
||||
|
||||
from typing import overload, List, Any, AnyStr, Tuple, BinaryIO, TextIO
|
||||
import sys
|
||||
from typing import overload, List, Any, AnyStr, Sequence, Tuple, BinaryIO, TextIO
|
||||
|
||||
# ----- os.path variables -----
|
||||
supports_unicode_filenames = False
|
||||
@@ -21,6 +22,9 @@ devnull = ... # type: str
|
||||
def abspath(path: AnyStr) -> AnyStr: ...
|
||||
def basename(path: AnyStr) -> AnyStr: ...
|
||||
|
||||
if sys.version_info >= (3, 5):
|
||||
def commonpath(paths: Sequence[AnyStr]) -> AnyStr: ...
|
||||
|
||||
# NOTE: Empty List[bytes] results in '' (str) => fall back to Any return type.
|
||||
def commonprefix(list: List[AnyStr]) -> Any: ...
|
||||
def dirname(path: AnyStr) -> AnyStr: ...
|
||||
|
||||
Reference in New Issue
Block a user