Add type hints for pstats.SortKey available in Python >= 3.7 (#4523)

This commit is contained in:
Adam Lichtl
2020-09-10 22:34:43 -07:00
committed by GitHub
parent 6bf894bb82
commit 1bc7689cbc

View File

@@ -1,11 +1,25 @@
import sys
from _typeshed import AnyPath
from cProfile import Profile as _cProfile
from enum import Enum
from profile import Profile
from typing import IO, Any, Dict, Iterable, List, Optional, Text, Tuple, TypeVar, Union, overload
_Selector = Union[str, float, int]
_T = TypeVar("_T", bound=Stats)
if sys.version_info >= (3, 7):
class SortKey(str, Enum):
CALLS: str
CUMULATIVE: str
FILENAME: str
LINE: str
NAME: str
NFL: str
PCALLS: str
STDNAME: str
TIME: str
class Stats:
sort_arg_dict_default: Dict[str, Tuple[Any, str]]
def __init__(