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,4 +1,4 @@
from typing import AnyStr, Dict, List, Pattern
from typing import AnyStr, Pattern
class TextWrapper(object):
width: int = ...
@@ -16,7 +16,7 @@ class TextWrapper(object):
wordsep_re: Pattern[str] = ...
wordsep_simple_re: Pattern[str] = ...
whitespace_trans: str = ...
unicode_whitespace_trans: Dict[int, int] = ...
unicode_whitespace_trans: dict[int, int] = ...
uspace: int = ...
x: int = ...
def __init__(
@@ -31,7 +31,7 @@ class TextWrapper(object):
drop_whitespace: bool = ...,
break_on_hyphens: bool = ...,
) -> None: ...
def wrap(self, text: AnyStr) -> List[AnyStr]: ...
def wrap(self, text: AnyStr) -> list[AnyStr]: ...
def fill(self, text: AnyStr) -> AnyStr: ...
def wrap(
@@ -45,7 +45,7 @@ def wrap(
break_long_words: bool = ...,
drop_whitespace: bool = ...,
break_on_hyphens: bool = ...,
) -> List[AnyStr]: ...
) -> list[AnyStr]: ...
def fill(
text: AnyStr,
width: int = ...,