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 — C API: Rename _PyThreadState_GetUnchecked() to public PyThreadState_GetUnchecked · Issue #108867 · python/cpython

C API: Rename _PyThreadState_GetUnchecked() to public PyThreadState_GetUnchecked #108867

New issue
Copy link
New issue
Copy link
Closed
Closed
C API: Rename _PyThreadState_GetUnchecked() to public PyThreadState_GetUnchecked#108867
Copy link

Description

@vstinner
vstinner
opened on Sep 4, 2023
Issue body actions

The _PyThreadState_UncheckedGet() function was added in Python 3.5 (2016) by issue #70342 with commit bfd316e. I was asked by PyPy developers to have an API to get the current thread state, but don't call Py_FatalError() if it's NULL. See: https://mail.python.org/pipermail/python-dev/2016-January/142767.html

In Python 3.13, I'm trying to remove private functions from the public C API: issue #106320.

Since _PyThreadState_UncheckedGet() had at least one user and exposing this API is revelant, I propose renaming the private _PyThreadState_UncheckedGet() function to PyThreadState_GetUnchecked() and so make it public, but not added it to the limited C API (not needed).

For the function name, see: capi-workgroup/problems#52 I propose to use the Unsafe suffix for "unsafe" function. Previously, the function used Unchecked, but it wasn't a suffix!

UPDATE: I renamed PyThreadState_GetUnsafe() to PyThreadState_GetUnchecked().

Linked PRs

  • gh-108867: Add PyThreadState_GetUnchecked() function #108870

Activity

  1. vstinner
    added 3 commits that reference this issue on Sep 4, 2023

    pythongh-108867: Add PyThreadState_GetUnsafe() function

    df5c95f

    pythongh-108867: Add PyThreadState_GetUnsafe() function

    c180b5b

    pythongh-108867: Add PyThreadState_GetUnsafe() function

    572f4a4
  2. vstinner
    changed the title [-]C API: Rename _PyThreadState_UncheckedGet() to public PyThreadState_GetUnsafe()[/-] [+]C API: Rename _PyThreadState_GetUnchecked() to public PyThreadState_GetUnsafe()[/+] on Sep 12, 2023
  3. vstinner
    added a commit that references this issue on Oct 3, 2023

    pythongh-108867: Add PyThreadState_GetUnsafe() function

    6e6be1b
  4. vstinner
    changed the title [-]C API: Rename _PyThreadState_GetUnchecked() to public PyThreadState_GetUnsafe()[/-] [+]C API: Rename _PyThreadState_GetUnchecked() to public PyThreadState_GetUnchecked[/+] on Oct 3, 2023
  5. vstinner
    added a commit that references this issue on Oct 3, 2023

    pythongh-108867: Add PyThreadState_GetUnchecked() function

    2372091
  6. vstinner commented on Oct 3, 2023

    @vstinner
    vstinner
    on Oct 3, 2023
    MemberAuthor
    More actions

    UPDATE: I renamed PyThreadState_GetUnsafe() to PyThreadState_GetUnchecked().

  7. vstinner
    added a commit that references this issue on Oct 3, 2023

    gh-108867: Add PyThreadState_GetUnchecked() function (#108870)

    d735016
  8. vstinner
    closed this as completedon Oct 3, 2023
  9. Glyphack
    added a commit that references this issue on Sep 2, 2024

    pythongh-108867: Add PyThreadState_GetUnchecked() function (python#10…

    5fd59fe
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

    No labels
    No labels

    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.