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,4 +1,4 @@
from typing import IO, Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
from typing import IO, Any, Callable, Dict, List, Sequence, Tuple, Union
_Timer = Callable[[], float]
_Stmt = Union[str, Callable[[], Any]]
@@ -7,15 +7,15 @@ default_timer: _Timer
class Timer:
def __init__(
self, stmt: _Stmt = ..., setup: _Stmt = ..., timer: _Timer = ..., globals: Optional[Dict[str, Any]] = ...
self, stmt: _Stmt = ..., setup: _Stmt = ..., timer: _Timer = ..., globals: Dict[str, Any] | None = ...
) -> 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]: ...
def autorange(self, callback: Optional[Callable[[int, float], Any]] = ...) -> Tuple[int, float]: ...
def autorange(self, callback: Callable[[int, float], Any] | None = ...) -> Tuple[int, float]: ...
def timeit(
stmt: _Stmt = ..., setup: _Stmt = ..., timer: _Timer = ..., number: int = ..., globals: Optional[Dict[str, Any]] = ...
stmt: _Stmt = ..., setup: _Stmt = ..., timer: _Timer = ..., number: int = ..., globals: Dict[str, Any] | None = ...
) -> float: ...
def repeat(
stmt: _Stmt = ...,
@@ -23,9 +23,9 @@ def repeat(
timer: _Timer = ...,
repeat: int = ...,
number: int = ...,
globals: Optional[Dict[str, Any]] = ...,
globals: Dict[str, Any] | None = ...,
) -> List[float]: ...
_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: ...