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

@@ -1,12 +1,12 @@
import sys
from _typeshed import Self
from typing import Any, BinaryIO, Generic, Iterable, MutableSequence, TypeVar, Union, overload
from typing import Any, BinaryIO, Generic, Iterable, MutableSequence, TypeVar, overload
from typing_extensions import Literal, SupportsIndex
_IntTypeCode = Literal["b", "B", "h", "H", "i", "I", "l", "L", "q", "Q"]
_FloatTypeCode = Literal["f", "d"]
_UnicodeTypeCode = Literal["u"]
_TypeCode = Union[_IntTypeCode, _FloatTypeCode, _UnicodeTypeCode]
_TypeCode = _IntTypeCode | _FloatTypeCode | _UnicodeTypeCode
_T = TypeVar("_T", int, float, str)