posixpath.commonpath supports Iterable parameter (#11310)

This commit is contained in:
Avasam
2024-01-29 07:13:34 -05:00
committed by GitHub
parent a661dcc6b4
commit 81070c4dbc

View File

@@ -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,