Switch to PEP-604 syntax in python2 stubs (#5915)

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
This commit is contained in:
Oleg Höfling
2021-08-14 11:12:30 +02:00
committed by GitHub
parent 431c4f7fc1
commit ff63953188
235 changed files with 2473 additions and 2768 deletions

View File

@@ -1,4 +1,4 @@
from typing import IO, Any, Callable, List, Optional, Sequence, Text, Union
from typing import IO, Any, Callable, List, Sequence, Text, Union
_str = Union[str, Text]
_Timer = Callable[[], float]
@@ -8,7 +8,7 @@ default_timer: _Timer
class Timer:
def __init__(self, stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ...) -> None: ...
def print_exc(self, file: Optional[IO[str]] = ...) -> None: ...
def print_exc(self, file: IO[str] | None = ...) -> None: ...
def timeit(self, number: int = ...) -> float: ...
def repeat(self, repeat: int = ..., number: int = ...) -> List[float]: ...
@@ -17,4 +17,4 @@ def repeat(stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ..., repeat: i
_timerFunc = Callable[[], float]
def main(args: Optional[Sequence[str]] = ..., *, _wrap_timer: Optional[Callable[[_timerFunc], _timerFunc]] = ...) -> None: ...
def main(args: Sequence[str] | None = ..., *, _wrap_timer: Callable[[_timerFunc], _timerFunc] | None = ...) -> None: ...