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,13 +1,13 @@
from _typeshed import Self
from cProfile import Profile as _cProfile
from profile import Profile
from typing import IO, Any, Dict, Iterable, List, Text, Tuple, TypeVar, Union, overload
from typing import IO, Any, Iterable, Text, TypeVar, Union, overload
_Selector = Union[str, float, int]
_T = TypeVar("_T", bound=Stats)
class Stats:
sort_arg_dict_default: Dict[str, Tuple[Any, str]]
sort_arg_dict_default: dict[str, tuple[Any, str]]
def __init__(
self: _T,
__arg: None | str | Text | Profile | _cProfile = ...,
@@ -19,7 +19,7 @@ class Stats:
def get_top_level_stats(self) -> None: ...
def add(self: Self, *arg_list: None | str | Text | Profile | _cProfile | Self) -> Self: ...
def dump_stats(self, filename: Text) -> None: ...
def get_sort_arg_defs(self) -> Dict[str, Tuple[Tuple[Tuple[int, int], ...], str]]: ...
def get_sort_arg_defs(self) -> dict[str, tuple[tuple[tuple[int, int], ...], str]]: ...
@overload
def sort_stats(self: Self, field: int) -> Self: ...
@overload
@@ -27,12 +27,12 @@ class Stats:
def reverse_order(self: Self) -> Self: ...
def strip_dirs(self: Self) -> Self: ...
def calc_callees(self) -> None: ...
def eval_print_amount(self, sel: _Selector, list: List[str], msg: str) -> Tuple[List[str], str]: ...
def get_print_list(self, sel_list: Iterable[_Selector]) -> Tuple[int, List[str]]: ...
def eval_print_amount(self, sel: _Selector, list: list[str], msg: str) -> tuple[list[str], str]: ...
def get_print_list(self, sel_list: Iterable[_Selector]) -> tuple[int, list[str]]: ...
def print_stats(self: Self, *amount: _Selector) -> Self: ...
def print_callees(self: Self, *amount: _Selector) -> Self: ...
def print_callers(self: Self, *amount: _Selector) -> Self: ...
def print_call_heading(self, name_size: int, column_title: str) -> None: ...
def print_call_line(self, name_size: int, source: str, call_dict: Dict[str, Any], arrow: str = ...) -> None: ...
def print_call_line(self, name_size: int, source: str, call_dict: dict[str, Any], arrow: str = ...) -> None: ...
def print_title(self) -> None: ...
def print_line(self, func: str) -> None: ...