Skip to content

Commit c6e54a1

Browse files
committed
match run / runctx / runeval to exec / eval parameters
1 parent cc79232 commit c6e54a1

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

stdlib/bdb.pyi

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
from _typeshed import ExcInfo, TraceFunction, Unused
2+
from _typeshed import ExcInfo, ReadableBuffer, TraceFunction, Unused
33
from collections.abc import Callable, Iterable, Iterator, Mapping
44
from contextlib import contextmanager
55
from types import CodeType, FrameType, TracebackType
@@ -85,11 +85,21 @@ class Bdb:
8585
def get_all_breaks(self) -> dict[str, list[int]]: ...
8686
def get_stack(self, f: FrameType | None, t: TracebackType | None) -> tuple[list[tuple[FrameType, int]], int]: ...
8787
def format_stack_entry(self, frame_lineno: tuple[FrameType, int], lprefix: str = ": ") -> str: ...
88-
def run(
89-
self, cmd: str | CodeType, globals: dict[str, Any] | None = None, locals: Mapping[str, Any] | None = None
88+
def run( # matches `builtins.exec`
89+
self,
90+
cmd: str | ReadableBuffer | CodeType,
91+
globals: dict[str, Any] | None = None,
92+
locals: Mapping[str, object] | None = None,
9093
) -> None: ...
91-
def runeval(self, expr: str, globals: dict[str, Any] | None = None, locals: Mapping[str, Any] | None = None) -> None: ...
92-
def runctx(self, cmd: str | CodeType, globals: dict[str, Any] | None, locals: Mapping[str, Any] | None) -> None: ...
94+
def runctx( # matches `builtins.exec`
95+
self, cmd: str | ReadableBuffer | CodeType, globals: dict[str, Any] | None, locals: Mapping[str, object] | None
96+
) -> None: ...
97+
def runeval( # matches `builtins.eval`
98+
self,
99+
expr: str | ReadableBuffer | CodeType,
100+
globals: dict[str, Any] | None = None,
101+
locals: Mapping[str, object] | None = None,
102+
) -> Any: ...
93103
def runcall(self, func: Callable[_P, _T], /, *args: _P.args, **kwds: _P.kwargs) -> _T | None: ...
94104
if sys.version_info >= (3, 14):
95105
def start_trace(self) -> None: ...

stdlib/pdb.pyi

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import signal
22
import sys
3+
from _typeshed import ReadableBuffer
34
from bdb import Bdb, _Backend
45
from cmd import Cmd
56
from collections.abc import Callable, Iterable, Mapping, Sequence
@@ -22,9 +23,15 @@ line_prefix: Final[str] # undocumented
2223

2324
class Restart(Exception): ...
2425

25-
def run(statement: str, globals: dict[str, Any] | None = None, locals: Mapping[str, Any] | None = None) -> None: ...
26-
def runeval(expression: str, globals: dict[str, Any] | None = None, locals: Mapping[str, Any] | None = None) -> Any: ...
27-
def runctx(statement: str, globals: dict[str, Any], locals: Mapping[str, Any]) -> None: ...
26+
def run( # matches `builtins.exec`
27+
statement: str | ReadableBuffer | CodeType, globals: dict[str, Any] | None = None, locals: Mapping[str, object] | None = None
28+
) -> None: ...
29+
def runctx( # matches `builtins.exec`
30+
statement: str | ReadableBuffer | CodeType, globals: dict[str, Any], locals: Mapping[str, object]
31+
) -> None: ...
32+
def runeval( # matches `builtins.eval`
33+
expression: str | ReadableBuffer | CodeType, globals: dict[str, Any] | None = None, locals: Mapping[str, object] | None = None
34+
) -> Any: ...
2835
def runcall(func: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> _T | None: ...
2936

3037
if sys.version_info >= (3, 14):

0 commit comments

Comments
 (0)