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 — Use `_Py` prefix for private C API added in 3.15 · Issue #149685 · python/cpython

Use _Py prefix for private C API added in 3.15 #149685

New issue
Copy link
New issue
Copy link
Closed
Closed
Use _Py prefix for private C API added in 3.15#149685
Copy link
Assignees
encukou
Labels
topic-C-APItype-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)

Description

@encukou
encukou
opened on May 11, 2026
Issue body actions

Sometimes we add C API (mainly macros) that should be private, but we don't use the _Py prefix. Usually it's due to similar existing names not using the prefix.
During the beta period, let's add _Py to the ones added in 3.15.

My annual scan noticed these:

Header guards:

  • Py_CPYTHON_SLICEOBJECT_H in Include/sliceobject.h
  • Py_CPYTHON_STRUCTSEQ_H in Include/structseq.h
  • Py_SENTINELOBJECT_H in Include/cpython/sentinelobject.h

Configure macros we chose a name for:

  • HAVE_EFFICIENT_BUILTIN_SHUFFLEVECTOR
  • HAVE_LIBGCC_EH_FRAME_REGISTRATION
  • HAVE_PR_SET_VMA_ANON_NAME

And for completeness, configure macros generated by autotools -- these are harder to change:

  • HAVE_CLEARENV
  • HAVE_PPOLL
  • HAVE_STATX
  • HAVE_STRUCT_STATX_STX_ATOMIC_WRITE_UNIT_MAX_OPT
  • HAVE_STRUCT_STATX_STX_ATOMIC_WRITE_UNIT_MIN
  • HAVE_STRUCT_STATX_STX_DIO_MEM_ALIGN
  • HAVE_STRUCT_STATX_STX_DIO_READ_OFFSET_ALIGN
  • HAVE_STRUCT_STATX_STX_MNT_ID
  • HAVE_STRUCT_STATX_STX_SUBVOL
  • HAVE_LINUX_CAN_ISOTP_H
  • HAVE_DECL_PR_SET_VMA_ANON_NAME

Linked PRs

  • gh-149685: Use the _Py prefix for private C macros #149686
  • [3.15] gh-149685: Use the _Py prefix for private C macros (GH-149686) #149790

Activity

  1. encukou
    self-assigned this
    on May 11, 2026
  2. encukou
    added
    topic-C-API
    type-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)
    on May 11, 2026
  3. encukou
    added 2 commits that reference this issue on May 13, 2026

    gh-149685: Use the _Py prefix for private C macros (GH-149686)

    125f263

    [3.15] gh-149685: Use the _Py prefix for private C macros (GH-149686) (…

    63a4007
  4. encukou
    closed this as completedon May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @encukou
    encukou

Labels

topic-C-APItype-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)

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.