Skip to content
This repository has been archived by the owner on Dec 27, 2021. It is now read-only.

Commit

Permalink
profile.run(sort=...) can be a string (python#2413)
Browse files Browse the repository at this point in the history
The int form is only accepted for backward compatibility.
https://docs.python.org/3/library/profile.html#pstats.Stats.sort_stats
  • Loading branch information
bluetech authored and JelleZijlstra committed Aug 22, 2018
1 parent df516fa commit 8ab951c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions stdlib/2and3/cProfile.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Any, Callable, Dict, Optional, TypeVar
from typing import Any, Callable, Dict, Optional, TypeVar, Union

def run(statement: str, filename: Optional[str] = ..., sort: int = ...) -> None: ...
def runctx(statement: str, globals: Dict[str, Any], locals: Dict[str, Any], filename: Optional[str] = ..., sort: int = ...) -> None: ...
def run(statement: str, filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ...
def runctx(statement: str, globals: Dict[str, Any], locals: Dict[str, Any], filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ...

_SelfT = TypeVar('_SelfT', bound='Profile')
_T = TypeVar('_T')
Expand All @@ -10,7 +10,7 @@ class Profile:
def __init__(self, custom_timer: Callable[[], float] = ..., time_unit: float = ..., subcalls: bool = ..., builtins: bool = ...) -> None: ...
def enable(self) -> None: ...
def disable(self) -> None: ...
def print_stats(self, sort: int = ...) -> None: ...
def print_stats(self, sort: Union[str, int] = ...) -> None: ...
def dump_stats(self, file: str) -> None: ...
def create_stats(self) -> None: ...
def run(self: _SelfT, cmd: str) -> _SelfT: ...
Expand Down
8 changes: 4 additions & 4 deletions stdlib/2and3/profile.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Any, Callable, Dict, Optional, TypeVar
from typing import Any, Callable, Dict, Optional, TypeVar, Union

def run(statement: str, filename: Optional[str] = ..., sort: int = ...) -> None: ...
def runctx(statement: str, globals: Dict[str, Any], locals: Dict[str, Any], filename: Optional[str] = ..., sort: int = ...) -> None: ...
def run(statement: str, filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ...
def runctx(statement: str, globals: Dict[str, Any], locals: Dict[str, Any], filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ...

_SelfT = TypeVar('_SelfT', bound='Profile')
_T = TypeVar('_T')
Expand All @@ -11,7 +11,7 @@ class Profile:
def set_cmd(self, cmd: str) -> None: ...
def simulate_call(self, name: str) -> None: ...
def simulate_cmd_complete(self) -> None: ...
def print_stats(self, sort: int = ...) -> None: ...
def print_stats(self, sort: Union[str, int] = ...) -> None: ...
def dump_stats(self, file: str) -> None: ...
def create_stats(self) -> None: ...
def snapshot_stats(self) -> None: ...
Expand Down

0 comments on commit 8ab951c

Please sign in to comment.