mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Use PEP 604 syntax wherever possible (#7493)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user