Skip to content

Add some missing attribute annotations to trace.pyi #11091

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions stdlib/trace.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
import types
from _typeshed import StrPath, TraceFunction
from collections.abc import Callable, Mapping, Sequence
from _typeshed import Incomplete, StrPath, TraceFunction
from collections.abc import Callable, Iterable, Mapping, Sequence
from typing import Any, TypeVar
from typing_extensions import ParamSpec, TypeAlias

Expand All @@ -12,6 +12,12 @@ _P = ParamSpec("_P")
_FileModuleFunction: TypeAlias = tuple[str, str | None, str]

class CoverageResults:
counts: dict[tuple[str, int], int]
counter: dict[tuple[str, int], int]
calledfuncs: dict[_FileModuleFunction, int]
callers: dict[tuple[_FileModuleFunction, _FileModuleFunction], int]
inifile: StrPath | None
outfile: StrPath | None
def __init__(
self,
counts: dict[tuple[str, int], int] | None = None,
Expand All @@ -27,7 +33,21 @@ class CoverageResults:
) -> tuple[int, int]: ...
def is_ignored_filename(self, filename: str) -> bool: ... # undocumented

class _Ignore:
def __init__(self, modules: Iterable[str] | None = None, dirs: Iterable[StrPath] | None = None) -> None: ...
def names(self, filename: str, modulename: str) -> int: ...

class Trace:
inifile: StrPath | None
outfile: StrPath | None
ignore: _Ignore
counts: dict[str, int]
pathtobasename: dict[Incomplete, Incomplete]
donothing: int
trace: int
start_time: int | None
globaltrace: TraceFunction
localtrace: TraceFunction
def __init__(
self,
count: int = 1,
Expand Down