Skip to content

gh-68656: Pass CO_* constants for inspect from C; deprecate CO_NOFREE - #159461

Open
encukou wants to merge 1 commit into
python:mainfrom
encukou:CO_opcode
Open

encukou wants to merge 1 commit into
python:mainfrom
encukou:CO_opcode

Conversation

@encukou

@encukou encukou commented Oct 15, 2026

Copy link
Copy Markdown
Member

The constants were redefined in dis.py, and not perfectly kept in sync: inspect.CO_NOFREE was kept even though the C define went away in gh-26839.

…NOFREE

The constants were redefined in dis.py, and not perfectly kept in
sync: inspect.CO_NOFREE was kept even though the C define went away
in pythongh-26839.

- Expose the constants via `_opcode` (as agreed in pythongh-68656)
  and its wrapper `opcode`.
  This removes `CO_NOFREE` from `dis.COMPILER_FLAG_NAMES`.
- Re-add, deprecate and document inspect.CO_NOFREE
@read-the-docs-community

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant