mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
add missing type hints in trace (#5865)
* Parameter func in Trace.runfunc() became positional only in Python 3.9 * Add is_ignored_filename()
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import sys
|
||||
import types
|
||||
from _typeshed import StrPath
|
||||
from typing import Any, Callable, Dict, Mapping, Optional, Sequence, Tuple, TypeVar, Union
|
||||
@@ -20,6 +21,7 @@ class CoverageResults:
|
||||
def write_results_file(
|
||||
self, path: StrPath, lines: Sequence[str], lnotab: Any, lines_hit: Mapping[int, int], encoding: Optional[str] = ...
|
||||
) -> Tuple[int, int]: ...
|
||||
def is_ignored_filename(self, filename: str) -> bool: ... # undocumented
|
||||
|
||||
class Trace:
|
||||
def __init__(
|
||||
@@ -41,7 +43,10 @@ class Trace:
|
||||
globals: Optional[Mapping[str, Any]] = ...,
|
||||
locals: Optional[Mapping[str, Any]] = ...,
|
||||
) -> None: ...
|
||||
def runfunc(self, func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def runfunc(self, __func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ...
|
||||
else:
|
||||
def runfunc(self, func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ...
|
||||
def file_module_function_of(self, frame: types.FrameType) -> _fileModuleFunction: ...
|
||||
def globaltrace_trackcallers(self, frame: types.FrameType, why: str, arg: Any) -> None: ...
|
||||
def globaltrace_countfuncs(self, frame: types.FrameType, why: str, arg: Any) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user