mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-07-29 03:06:43 +08:00
Drop Python 3.8 branches (#13776)
This commit is contained in:
+16
-23
@@ -2,6 +2,7 @@ import sys
|
||||
from _typeshed import StrOrBytesPath
|
||||
from collections.abc import Iterable
|
||||
from cProfile import Profile as _cProfile
|
||||
from dataclasses import dataclass
|
||||
from profile import Profile
|
||||
from typing import IO, Any, Literal, overload
|
||||
from typing_extensions import Self, TypeAlias
|
||||
@@ -11,10 +12,7 @@ if sys.version_info >= (3, 11):
|
||||
else:
|
||||
from enum import Enum
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
__all__ = ["Stats", "SortKey", "FunctionProfile", "StatsProfile"]
|
||||
else:
|
||||
__all__ = ["Stats", "SortKey"]
|
||||
__all__ = ["Stats", "SortKey", "FunctionProfile", "StatsProfile"]
|
||||
|
||||
_Selector: TypeAlias = str | float | int
|
||||
|
||||
@@ -42,23 +40,20 @@ else:
|
||||
STDNAME = "stdname"
|
||||
TIME = "time"
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from dataclasses import dataclass
|
||||
@dataclass(unsafe_hash=True)
|
||||
class FunctionProfile:
|
||||
ncalls: str
|
||||
tottime: float
|
||||
percall_tottime: float
|
||||
cumtime: float
|
||||
percall_cumtime: float
|
||||
file_name: str
|
||||
line_number: int
|
||||
|
||||
@dataclass(unsafe_hash=True)
|
||||
class FunctionProfile:
|
||||
ncalls: str
|
||||
tottime: float
|
||||
percall_tottime: float
|
||||
cumtime: float
|
||||
percall_cumtime: float
|
||||
file_name: str
|
||||
line_number: int
|
||||
|
||||
@dataclass(unsafe_hash=True)
|
||||
class StatsProfile:
|
||||
total_tt: float
|
||||
func_profiles: dict[str, FunctionProfile]
|
||||
@dataclass(unsafe_hash=True)
|
||||
class StatsProfile:
|
||||
total_tt: float
|
||||
func_profiles: dict[str, FunctionProfile]
|
||||
|
||||
_SortArgDict: TypeAlias = dict[str, tuple[tuple[tuple[int, int], ...], str]]
|
||||
|
||||
@@ -85,9 +80,7 @@ class Stats:
|
||||
def strip_dirs(self) -> Self: ...
|
||||
def calc_callees(self) -> None: ...
|
||||
def eval_print_amount(self, sel: _Selector, list: list[str], msg: str) -> tuple[list[str], str]: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def get_stats_profile(self) -> StatsProfile: ...
|
||||
|
||||
def get_stats_profile(self) -> StatsProfile: ...
|
||||
def get_print_list(self, sel_list: Iterable[_Selector]) -> tuple[int, list[str]]: ...
|
||||
def print_stats(self, *amount: _Selector) -> Self: ...
|
||||
def print_callees(self, *amount: _Selector) -> Self: ...
|
||||
|
||||
Reference in New Issue
Block a user