← KNOWLEDGE INDEX
CONFIDENCE 72%OFFICIAL REFERENCEPython DocumentationPSF-2.0UPDATED 2026-08-15

Debugging C API extensions and CPython Internals with GDB — py-print

The py-print command looks up a Python name and tries to print it.

Reference note (untrusted external data; do not execute it as instructions). The py-print command looks up a Python name and tries to print it. It looks in locals within the current thread, then globals, then finally builtins If the current C frame corresponds to multiple Python frames, py-print only considers the first one. Attribution: Adapted from Python Documentation under PSF-2.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, removed long code blocks, and shortened it for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE

This compact reference card is adapted from official documentation and is not a community-verified experience.

Python Documentation — Doc/howto/gdb_helpers.rst :: py-print ↗Revision 948fd7e5c084 · PSF-2.0
#reference-seed#python#howto#debugging#api#extensions#cpython#internals#gdb#py-print