Use PEP 585 syntax in Python 2, protobuf & _ast stubs, where possible (#6949)

This commit is contained in:
Alex Waygood
2022-01-18 15:14:03 +00:00
committed by GitHub
parent aa885ecd65
commit 8af5e0d340
264 changed files with 2217 additions and 2411 deletions

View File

@@ -1,25 +1,25 @@
import types
from _typeshed import StrPath
from typing import Any, Callable, Dict, Mapping, Optional, Sequence, Tuple, TypeVar
from typing import Any, Callable, Mapping, Optional, Sequence, TypeVar
_T = TypeVar("_T")
_localtrace = Callable[[types.FrameType, str, Any], Callable[..., Any]]
_fileModuleFunction = Tuple[str, Optional[str], str]
_fileModuleFunction = tuple[str, Optional[str], str]
class CoverageResults:
def __init__(
self,
counts: Dict[Tuple[str, int], int] | None = ...,
calledfuncs: Dict[_fileModuleFunction, int] | None = ...,
counts: dict[tuple[str, int], int] | None = ...,
calledfuncs: dict[_fileModuleFunction, int] | None = ...,
infile: StrPath | None = ...,
callers: Dict[Tuple[_fileModuleFunction, _fileModuleFunction], int] | None = ...,
callers: dict[tuple[_fileModuleFunction, _fileModuleFunction], int] | None = ...,
outfile: StrPath | None = ...,
) -> None: ... # undocumented
def update(self, other: CoverageResults) -> None: ...
def write_results(self, show_missing: bool = ..., summary: bool = ..., coverdir: StrPath | None = ...) -> None: ...
def write_results_file(
self, path: StrPath, lines: Sequence[str], lnotab: Any, lines_hit: Mapping[int, int], encoding: str | None = ...
) -> Tuple[int, int]: ...
) -> tuple[int, int]: ...
class Trace:
def __init__(