Use PEP 585 syntax in Python 2, protobuf & _ast stubs, where possible (#6949)

This commit is contained in:
Alex Waygood
2022-01-18 15:14:03 +00:00
committed by GitHub
parent aa885ecd65
commit 8af5e0d340
264 changed files with 2217 additions and 2411 deletions

View File

@@ -1,5 +1,5 @@
from _typeshed import SupportsLessThanT
from typing import List, Sequence, Text, Tuple, Union, overload
from typing import Sequence, Text, Union, overload
from typing_extensions import Literal
# All overloads can return empty string. Ideally, Literal[""] would be a valid
@@ -10,9 +10,9 @@ def commonprefix(m: Sequence[str]) -> str | Literal[""]: ... # type: ignore
@overload
def commonprefix(m: Sequence[Text]) -> Text: ... # type: ignore
@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 commonprefix(m: Sequence[tuple[SupportsLessThanT, ...]]) -> Sequence[SupportsLessThanT]: ...
def exists(path: Text) -> bool: ...
def getsize(filename: Text) -> int: ...
def isfile(path: Text) -> bool: ...