Use PEP 604 syntax wherever possible (#7493)

This commit is contained in:
Alex Waygood
2022-03-16 15:01:33 +00:00
committed by GitHub
parent 15e21a8dc1
commit 3ab250eec8
174 changed files with 472 additions and 490 deletions

View File

@@ -2,7 +2,7 @@ import sys
from _typeshed import StrOrBytesPath
from builtins import open as _builtin_open
from token import *
from typing import Any, Callable, Generator, Iterable, NamedTuple, Pattern, Sequence, TextIO, Union
from typing import Any, Callable, Generator, Iterable, NamedTuple, Pattern, Sequence, TextIO
if sys.version_info >= (3, 10):
__all__ = [
@@ -331,7 +331,7 @@ class TokenInfo(_TokenInfo):
def exact_type(self) -> int: ...
# Backwards compatible tokens can be sequences of a shorter length too
_Token = Union[TokenInfo, Sequence[Union[int, str, _Position]]]
_Token = TokenInfo | Sequence[int | str | _Position]
class TokenError(Exception): ...
class StopTokenizing(Exception): ... # undocumented