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,18 +1,6 @@
import sys
from _typeshed import Self, _T_co
from typing import (
Any,
Callable,
Generic,
Iterable,
Iterator,
SupportsComplex,
SupportsFloat,
SupportsInt,
TypeVar,
Union,
overload,
)
from typing import Any, Callable, Generic, Iterable, Iterator, SupportsComplex, SupportsFloat, SupportsInt, TypeVar, overload
from typing_extensions import Literal, SupportsIndex
if sys.version_info >= (3, 9):
@@ -21,7 +9,7 @@ if sys.version_info >= (3, 9):
_T = TypeVar("_T")
_S = TypeVar("_S")
_N = TypeVar("_N", int, float, SupportsFloat, SupportsInt, SupportsIndex, SupportsComplex)
_Step = Union[int, float, SupportsFloat, SupportsInt, SupportsIndex, SupportsComplex]
_Step = int | float | SupportsFloat | SupportsInt | SupportsIndex | SupportsComplex
Predicate = Callable[[_T], object]