Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions stdlib/@tests/stubtest_allowlists/py313.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ inspect._ParameterKind.description # Still exists, but stubtest can't see it
typing\._SpecialForm.* # Super-special typing primitive
typing\.LiteralString # Super-special typing primitive

# Don't always exist at runtime
(pdb.Pdb.curframe_locals)?

# ==================================================================
# Allowlist entries that cannot or should not be fixed; 3.11 to 3.13
Expand Down
14 changes: 12 additions & 2 deletions stdlib/pdb.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ from linecache import _ModuleGlobals
from rlcompleter import Completer
from types import CodeType, FrameType, TracebackType
from typing import IO, Any, ClassVar, Final, Literal, TypeVar
from typing_extensions import ParamSpec, Self, TypeAlias
from typing_extensions import ParamSpec, Self, TypeAlias, deprecated

__all__ = ["run", "pm", "Pdb", "runeval", "runctx", "runcall", "set_trace", "post_mortem", "help"]
if sys.version_info >= (3, 14):
Expand Down Expand Up @@ -60,7 +60,17 @@ class Pdb(Bdb, Cmd):
stack: list[tuple[FrameType, int]]
curindex: int
curframe: FrameType | None
curframe_locals: Mapping[str, Any]
if sys.version_info >= (3, 13):
Copy link
Contributor Author

@max-muoto max-muoto Dec 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.13 due as - The low overhead dynamic frame locals access added in Python 3.13 by PEP 667 means the frame locals cache reference previously stored in this attribute is no longer needed. Derived debuggers should access pdb.Pdb.curframe.f_locals directly in Python 3.13 and later versions.

@property
@deprecated("The frame locals reference is no longer cached. Use 'curframe.f_locals' instead.")
def curframe_locals(self) -> Mapping[str, Any]: ...
@curframe_locals.setter
@deprecated(
"Setting 'curframe_locals' no longer has any effect as of 3.14. Update the contents of 'curframe.f_locals' instead."
)
def curframe_locals(self, value: Mapping[str, Any]) -> None: ...
else:
curframe_locals: Mapping[str, Any]
if sys.version_info >= (3, 14):
mode: _Mode | None
colorize: bool
Expand Down