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