Add timeit.main (#2731)

This function is exposed to external users of timeit, and can come in useful if you merely want to provide defaults to timeit.main (albeit awkwardly).
This commit is contained in:
Luke Granger-Brown
2019-03-12 16:37:10 +00:00
committed by Jelle Zijlstra
parent 6b6d8c82ac
commit b71ccbb136

View File

@@ -1,7 +1,7 @@
# Stubs for timeit (Python 2 and 3)
import sys
from typing import Any, Callable, Dict, IO, List, Optional, Text, Tuple, Union
from typing import Any, Callable, Dict, IO, List, Optional, Sequence, Text, Tuple, Union
_str = Union[str, Text]
_Timer = Callable[[], float]
@@ -31,3 +31,4 @@ else:
number: int = ...) -> float: ...
def repeat(stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ...,
repeat: int = ..., number: int = ...) -> List[float]: ...
def main(args: Optional[Sequence[str]]) -> None: ...