GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Immortal objects and the C API docs · Issue #104597 · python/cpython

Immortal objects and the C API docs #104597

New issue
Copy link
New issue
Copy link
Closed
Closed
Immortal objects and the C API docs#104597
Copy link
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dirtopic-C-API

Description

@JelleZijlstra
JelleZijlstra
opened on May 18, 2023
Issue body actions

https://docs.python.org/3.12/c-api/none.html#c.Py_None currently says that Py_None "needs to be treated just like any other object with respect to reference counts". That's not really true now that we have PEP-683 immortal objects: there is no need to incref/decref it. There are several similar places, e.g. https://docs.python.org/3.12/c-api/slice.html#ellipsis-object and https://docs.python.org/3.12/c-api/bool.html#c.Py_False.

The docs should be updated to somehow refer to the fact that these objects are immortal. However, extension authors who want to retain support for 3.11 and lower should continue to refcount None etc. correctly, so we shouldn't completely omit discussion of refcounting.

cc @eduardo-elizondo

Reacted by Eddie Elizondo

Activity

  1. JelleZijlstra
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    on May 18, 2023
  2. eduardo-elizondo commented on May 18, 2023

    @eduardo-elizondo
    eduardo-elizondo
    on May 18, 2023
    Contributor
    More actions

    Oh that's a great point, let me make a note of this to go through the C-API Docs this weekend and update all the relevant singletons.

    Debating whether to add a 3.12 note only or if we should change the whole section to reflect immortality and just have a note for < 3.11

  3. carljm commented on May 18, 2023

    @carljm
    carljm
    on May 18, 2023
    Member
    More actions

    Debating whether to add a 3.12 note only or if we should change the whole section to reflect immortality and just have a note for < 3.11

    The docs are per-version, so the 3.12 docs should document the state of 3.12. It's good to include a .. versionchanged: 3.12 note, though.

    Reacted by Eddie Elizondo, Erlend E. Aasland, sunmy2019 and Alex Waygood
  4. eduardo-elizondo commented on Jun 4, 2023

    @eduardo-elizondo
    eduardo-elizondo
    on Jun 4, 2023
    Contributor
    More actions

    This has now been addressed by @iritkatriel in GH-105195! We can probably close this issue now 🙂

  5. iritkatriel commented on Jun 4, 2023

    @iritkatriel
    iritkatriel
    on Jun 4, 2023
    Member
    More actions

    Sorry I didn't notice this issue. My PR is not reviewed/merged yet though.

  6. eduardo-elizondo commented on Jun 4, 2023

    @eduardo-elizondo
    eduardo-elizondo
    on Jun 4, 2023
    Contributor
    More actions

    My PR is not reviewed/merged yet though.

    Ah my bad, you are right, I misread. Alright let's see if we can push your PR to resolve this issue

  7. AlexWaygood
    added
    topic-C-API
    on Jun 4, 2023
  8. vstinner commented on Jan 27, 2025

    @vstinner
    vstinner
    on Jan 27, 2025
    Member
    More actions

    cc @ZeroIntensity

  9. ZeroIntensity commented on Jan 28, 2025

    @ZeroIntensity
    ZeroIntensity
    on Jan 28, 2025
    Member
    More actions

    It looks like most of the objects in question have been documented with an immortality note, is there anything else to do here?

  10. vstinner commented on Jan 28, 2025

    @vstinner
    vstinner
    on Jan 28, 2025
    Member
    More actions

    The docs should be updated to somehow refer to the fact that these objects are immortal.

    I confirm that the doc has been updated. I close the issue.

    Reacted by Peter Bierma
  11. vstinner
    closed this as completedon Jan 28, 2025
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

    docsDocumentation in the Doc dirDocumentation in the Doc dirtopic-C-API

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.