mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
posixpath.commonpath supports Iterable parameter (#11310)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from _typeshed import AnyOrLiteralStr, BytesPath, FileDescriptorOrPath, StrOrBytesPath, StrPath
|
||||
from collections.abc import Sequence
|
||||
from collections.abc import Iterable
|
||||
from genericpath import (
|
||||
commonprefix as commonprefix,
|
||||
exists as exists,
|
||||
@@ -102,11 +102,11 @@ def normpath(path: PathLike[AnyStr]) -> AnyStr: ...
|
||||
@overload
|
||||
def normpath(path: AnyOrLiteralStr) -> AnyOrLiteralStr: ...
|
||||
@overload
|
||||
def commonpath(paths: Sequence[LiteralString]) -> LiteralString: ...
|
||||
def commonpath(paths: Iterable[LiteralString]) -> LiteralString: ...
|
||||
@overload
|
||||
def commonpath(paths: Sequence[StrPath]) -> str: ...
|
||||
def commonpath(paths: Iterable[StrPath]) -> str: ...
|
||||
@overload
|
||||
def commonpath(paths: Sequence[BytesPath]) -> bytes: ...
|
||||
def commonpath(paths: Iterable[BytesPath]) -> bytes: ...
|
||||
|
||||
# First parameter is not actually pos-only,
|
||||
# but must be defined as pos-only in the stub or cross-platform code doesn't type-check,
|
||||
|
||||
Reference in New Issue
Block a user