mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-23 04:11:28 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user