mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-03-16 03:24:54 +08:00
Big diff: use lower-case list and dict (#5888)
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
import os
|
||||
from _typeshed import BytesPath, StrOrBytesPath, StrPath, SupportsLessThanT
|
||||
from typing import List, Sequence, Tuple, overload
|
||||
from typing import Sequence, Tuple, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
# All overloads can return empty string. Ideally, Literal[""] would be a valid
|
||||
# Iterable[T], so that List[T] | Literal[""] could be used as a return
|
||||
# Iterable[T], so that list[T] | Literal[""] could be used as a return
|
||||
# type. But because this only works when T is str, we need Sequence[T] instead.
|
||||
@overload
|
||||
def commonprefix(m: Sequence[StrPath]) -> str: ...
|
||||
@overload
|
||||
def commonprefix(m: Sequence[BytesPath]) -> bytes | Literal[""]: ...
|
||||
@overload
|
||||
def commonprefix(m: Sequence[List[SupportsLessThanT]]) -> Sequence[SupportsLessThanT]: ...
|
||||
def commonprefix(m: Sequence[list[SupportsLessThanT]]) -> Sequence[SupportsLessThanT]: ...
|
||||
@overload
|
||||
def commonprefix(m: Sequence[Tuple[SupportsLessThanT, ...]]) -> Sequence[SupportsLessThanT]: ...
|
||||
def exists(path: StrOrBytesPath) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user