Big diff: Use new "|" union syntax (#5872)

This commit is contained in:
Akuli
2021-08-08 12:05:21 +03:00
committed by GitHub
parent b9adb7a874
commit ee487304d7
578 changed files with 8080 additions and 8966 deletions

View File

@@ -1,13 +1,13 @@
from typing import Any, Callable, Iterable, Optional, TypeVar, Union, overload
from typing import Any, Callable, Iterable, TypeVar, overload
_T = TypeVar("_T")
_S = TypeVar("_S")
@overload
def first(iterable: Iterable[_T]) -> Optional[_T]: ...
def first(iterable: Iterable[_T]) -> _T | None: ...
@overload
def first(iterable: Iterable[_T], default: _S) -> Union[_T, _S]: ...
def first(iterable: Iterable[_T], default: _S) -> _T | _S: ...
@overload
def first(iterable: Iterable[_T], default: _S, key: Optional[Callable[[_T], Any]]) -> Union[_T, _S]: ...
def first(iterable: Iterable[_T], default: _S, key: Callable[[_T], Any] | None) -> _T | _S: ...
@overload
def first(iterable: Iterable[_T], *, key: Optional[Callable[[_T], Any]]) -> Optional[_T]: ...
def first(iterable: Iterable[_T], *, key: Callable[[_T], Any] | None) -> _T | None: ...