]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-127274: Defer nested methods (#128012)
authormpage <mpage@meta.com>
Thu, 19 Dec 2024 21:03:14 +0000 (13:03 -0800)
committerGitHub <noreply@github.com>
Thu, 19 Dec 2024 21:03:14 +0000 (13:03 -0800)
commit255762c09fe518757bb3e8ce1bb6e5d8eec9f466
tree179d8f0893a0550d2f73359da6e20d4df05e01e2
parente163e8d4e1a9844b8615ef38b9917b887a377948
gh-127274: Defer nested methods (#128012)

Methods (functions defined in class scope) are likely to be cleaned
up by the GC anyway.

Add a new code flag, `CO_METHOD`, that is set for functions defined
in a class scope. Use that when deciding to defer functions.
Doc/library/inspect.rst
Include/cpython/code.h
Include/internal/pycore_symtable.h
Lib/dis.py
Lib/inspect.py
Lib/test/test_monitoring.py
Lib/test/test_opcache.py
Misc/NEWS.d/next/Core_and_Builtins/2024-12-17-13-45-33.gh-issue-127274.deNxNC.rst [new file with mode: 0644]
Objects/funcobject.c
Python/compile.c
Python/symtable.c