cpython/InternalDocs
Neil Schemenauer 350c58ba4e
GH-135552: Make the GC clear weakrefs later (GH-136189)
Fix a bug caused by the garbage collector clearing weakrefs too early.  The
weakrefs in the ``tp_subclasses`` dictionary are needed in order to correctly
invalidate type caches (for example, by calling ``PyType_Modified()``).
Clearing weakrefs before calling finalizers causes the caches to not be
correctly invalidated.  That can cause crashes since the caches can refer to
invalid objects.  Defer the clearing of weakrefs without callbacks until after
finalizers are executed.
2025-08-07 16:32:17 -07:00
..
images gh-119786: Move garbage collection doc from devguide to InternalDocs (#125282) 2024-10-11 21:18:37 +01:00
asyncio.md add async generators section to asyncio internal docs (#135674) 2025-06-23 06:22:28 +00:00
changing_grammar.md gh-119786: cleanup internal docs and fix internal links (#127485) 2024-12-01 17:12:22 +00:00
code_objects.md gh-119786: Add jit.md. Move adaptive.md to a section of interpreter.md. (#127175) 2024-12-06 16:36:06 +00:00
compiler.md gh-126835: Rename ast_opt.c to ast_preprocess.c and related stuff after moving const folding to the peephole optimizier (#131830) 2025-05-04 21:07:35 +03:00
exception_handling.md Improve format of InternalDocs/exception_handling.md (#134969) 2025-05-31 14:56:33 +03:00
frames.md InternalDocs: Fix outdated struct references in frames.md (#132613) 2025-04-20 23:24:21 +01:00
garbage_collector.md GH-135552: Make the GC clear weakrefs later (GH-136189) 2025-08-07 16:32:17 -07:00
generators.md Docs: Fix the _PyGenObject_HEAD reference in the InternalDocs/generators.md (#133739) 2025-05-18 21:56:58 +05:30
interpreter.md gh-119786: add JUMP_BACKWARD macro to the Jumps section (#131213) 2025-03-16 20:04:39 +00:00
jit.md Docs: Fix typo in InternalDocs/jit.md (#132119) 2025-04-05 12:36:16 +02:00
parser.md Fix some typos in various doc files (GH-132589) 2025-04-16 18:11:47 +00:00
qsbr.md gh-119786: Add InternalDocs/qsbr.md. (gh-135411) 2025-06-23 22:09:40 +00:00
README.md gh-119786: Add InternalDocs/qsbr.md. (gh-135411) 2025-06-23 22:09:40 +00:00
string_interning.md gh-119786: cleanup internal docs and fix internal links (#127485) 2024-12-01 17:12:22 +00:00

CPython Internals Documentation

The documentation in this folder is intended for CPython maintainers. It describes implementation details of CPython, which should not be assumed to be part of the Python language specification. These details can change between any two CPython versions and should not be assumed to hold for other implementations of the Python language.

The core dev team attempts to keep this documentation up to date. If it is not, please report that through the issue tracker.

Compiling Python Source Code

Runtime Objects

Program Execution

Modules