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 — Make PyCode_GetFirstFree a PEP-689 unstable API · Issue #115756 · python/cpython

Make PyCode_GetFirstFree a PEP-689 unstable API #115756

New issue
Copy link
New issue
Copy link
Closed
Closed
Make PyCode_GetFirstFree a PEP-689 unstable API#115756
Copy link
Labels
topic-C-API

Description

@erlend-aasland
erlend-aasland
opened on Feb 21, 2024
Issue body actions

It was and it wasn't. We don't really want to expose it, but if we don't then Cython and other C extensions will access the internal fields directly, which is worse.

Now that we have an unstable API, it should probably be part of that.
I'd like all code object C APIs to be unstable, but it's probably too late for that.

Maybe rename it to PyUnstableCode_GetFirstFree?

Originally posted by @markshannon in #115654 (comment)

Linked PRs

  • gh-115756: make PyCode_GetFirstFree an unstable API #115781

Activity

  1. erlend-aasland
    added
    topic-C-API
    on Feb 21, 2024
  2. erlend-aasland commented on Feb 21, 2024

    @erlend-aasland
    erlend-aasland
    on Feb 21, 2024
    ContributorAuthor
    More actions

    PyCode_GetFirstFree was introduced in PR #100721 (first appeared in 3.12.0a4)

  3. encukou commented on Feb 21, 2024

    @encukou
    encukou
    on Feb 21, 2024
    Member
    More actions

    The name should be PyUnstable_Code_GetFirstFree (extra underscore).

    Reacted by Bogdan Romanyuk and Erlend E. Aasland
  4. wrongnull commented on Feb 21, 2024

    @wrongnull
    wrongnull
    on Feb 21, 2024
    Contributor
    More actions

    Shouldn't this apply to PyCode_GetNumFree too?

  5. vstinner commented on Feb 22, 2024

    @vstinner
    vstinner
    on Feb 22, 2024
    Member
    More actions

    The function is part of Python 3.12 release, and after Python 3.12, you want to downgrade the API to the unstable API in Python 3.13? It sounds too late for me, no?

  6. erlend-aasland commented on Feb 22, 2024

    @erlend-aasland
    erlend-aasland
    on Feb 22, 2024
    ContributorAuthor
    More actions

    The function is part of Python 3.12 release, and after Python 3.12, you want to downgrade the API to the unstable API in Python 3.13? It sounds too late for me, no?

    I'll leave that for the C API WG ;)

  7. encukou commented on Mar 4, 2024

    @encukou
    encukou
    on Mar 4, 2024
    Member
    More actions

    The function is part of Python 3.12 release, and after Python 3.12, you want to downgrade the API to the unstable API in Python 3.13? It sounds too late for me, no?

    Downgrading means that the public name, PyCode_GetFirstFree, will be deprecated, but will be kept until the function's signature/behaviour changes (minimum 2 releases).
    Do you think this should not be done?

  8. vstinner commented on Mar 6, 2024

    @vstinner
    vstinner
    on Mar 6, 2024
    Member
    More actions

    Do you think this should not be done?

    I don't think that it's worth it. If later, the function becomes stable, depending on the Python version, PyCode_GetFirstFree() may be deprecated or not, it sounds unpleasant for a minor issue.

    Honestly, just elaborate the documentation to express more clearly the stability contract, no?

  9. encukou commented on Mar 6, 2024

    @encukou
    encukou
    on Mar 6, 2024
    Member
    More actions

    If later, the function becomes stable

    I don't think the intention is to ever make it stable. It exposes an implementation detail: free variables follow other ones in a code object.

    just elaborate the documentation to express more clearly the stability contract

    This is the way to do that.

    Reacted by Erlend E. Aasland
  10. vstinner commented on Mar 6, 2024

    @vstinner
    vstinner
    on Mar 6, 2024
    Member
    More actions

    Ping @markshannon

  11. encukou
    added a commit that references this issue on Mar 19, 2024

    gh-115756: make PyCode_GetFirstFree an unstable API (GH-115781)

    a8e93d3
  12. encukou commented on Mar 20, 2024

    @encukou
    encukou
    on Mar 20, 2024
    Member
    More actions

    Thank you!

    Reacted by Erlend E. Aasland
  13. encukou
    closed this as completedon Mar 20, 2024
  14. vstinner
    added a commit that references this issue on Mar 20, 2024

    pythongh-115756: make PyCode_GetFirstFree an unstable API (pythonGH-1…

    9ca3e2c
  15. adorilson
    added a commit that references this issue on Mar 25, 2024

    pythongh-115756: make PyCode_GetFirstFree an unstable API (pythonGH-1…

    245bdd5
  16. diegorusso
    added a commit that references this issue on Apr 17, 2024

    pythongh-115756: make PyCode_GetFirstFree an unstable API (pythonGH-1…

    40f3cf7
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

    topic-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.