Skip to content

Add an unstable C API for immortalizing objects #143300

Closed

Description

@ngoldbaum

I'd like to add a new C API to allow extensions to mark objects as immortal. See https://discuss.python.org/t/add-an-unstable-c-api-for-immortalizing-objects/105461 for discussion. I'm opening this issue to link a future PR and for visibility for people who don't look at discourse regularly.

Linked PRs

Activity

  1. picnixz commented on Dec 30, 2025

    @picnixz
    Member

    Considering this idea was already supported by a core dev and that another core dev chimed in to support it, I think it's fine to keep the issue. However, please note that I would have closed it because we don't want issues just for visibility or PRs just for PoCs. Those should be kept in forks, and discussion should still be kept on DPO.

    However, if the proposal becomes too large, it may require a PEP, in which case I'd prefer closing the issue now instead of having back and forth.

    @ZeroIntensity Do you think this requires a PEP? if so, I'd rather close this issue now as the process may be long.

  2. added
    type-featureA feature request or enhancement
    interpreter-core(Objects, Python, Grammar, and Parser dirs)
    triagedThe issue has been accepted as valid by a triager.
    and removed
    triagedThe issue has been accepted as valid by a triager.
    on Dec 30, 2025
  3. ZeroIntensity commented on Dec 30, 2025

    @ZeroIntensity
    Member

    This shouldn't need a PEP, as the idea and implementation are pretty simple. (This isn't proposing immortalization for arbitrary objects; that would require a PEP.) Though we should try to get the C API WG's blessing, because I suspect Petr has some reservations about the dangers of immortality.

  4. added a commit that references this issue on Feb 11, 2026
  5. added a commit that references this issue on Feb 15, 2026
  6. added a commit that references this issue on Feb 28, 2026
  7. added a commit that references this issue on Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions