Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Please addgetbufferproc andreleasebufferproc to the limited API headers #98410

Closed
Labels
@davidhewitt

Description

@davidhewitt

Feature or enhancement

Starting with Python 3.11 the Py_Buffer API hasbeen made available in the limited API, including thebf_getbuffer andbf_releasebuffer type slots.

However the definitions for the function pointer types stored in those slots,getbufferproc andreleasebufferproc are stillonly defined when including "cpython" headers.

This means on the limited API starting with Python 3.11 it is now possible to doPyType_GetSlot(Py_TYPE(obj), Py_bf_getbuffer), however thevoid * returned does not have a function pointer type available which it can be cast to (unless the user adds this typedef themselves in their own code).

Pitch

This is a relatively straightforward change to make use of these type slots more convenient on the limited API.

I wrote an initial implementation at#31158. A couple of tiny tweaks beyond moving the typedefs was necessary so that forward definitions continued to function. Please see that PR for the detail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp