Files
typeshed/stdlib/2and3/pstats.pyi
Jelle Zijlstra 1d6e3f492e Fix incorrect usage of AnyStr (#1215)
* Fix incorrect usage of AnyStr

- sqlite3 was using Union[bytes, AnyStr], which doesn't make sense
- The urllib functions I changed accept either bytes or str for their "safe"
  argument
- Also added supports for PathLike to pstats
- Remove some unused imports of AnyStr

* pstats: python 2 accepts unicode
2017-04-27 08:47:59 -07:00

40 lines
1.9 KiB
Python

from profile import Profile
from cProfile import Profile as cProfile
import os
import sys
from typing import Any, Dict, IO, Iterable, List, Text, Tuple, TypeVar, Union, overload
_Selector = Union[str, float, int]
_T = TypeVar('_T', bound='Stats')
if sys.version_info >= (3, 6):
_Path = Union[bytes, Text, os.PathLike[Any]]
else:
_Path = Union[bytes, Text]
class Stats:
def __init__(self: _T, __arg: Union[None, str, Text, Profile, cProfile] = ...,
*args: Union[None, str, Text, Profile, cProfile, _T],
stream: IO[Any] = ...) -> None: ...
def init(self, arg: Union[None, str, Text, Profile, cProfile]) -> None: ...
def load_stats(self, arg: Union[None, str, Text, Profile, cProfile]) -> None: ...
def get_top_level_stats(self) -> None: ...
def add(self: _T, *arg_list: Union[None, str, Text, Profile, cProfile, _T]) -> _T: ...
def dump_stats(self, filename: _Path) -> None: ...
def get_sort_arg_defs(self) -> Dict[str, Tuple[Tuple[Tuple[int, int], ...], str]]: ...
@overload
def sort_stats(self: _T, field: int) -> _T: ...
@overload
def sort_stats(self: _T, *field: str) -> _T: ...
def reverse_order(self: _T) -> _T: ...
def strip_dirs(self: _T) -> _T: ...
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 print_stats(self: _T, *amount: _Selector) -> _T: ...
def print_callees(self: _T, *amount: _Selector) -> _T: ...
def print_callers(self: _T, *amount: _Selector) -> _T: ...
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_title(self) -> None: ...
def print_line(self, func: str) -> None: ...