Skip to content

bpo-45459: Add Py_buffer to limited API - #29991

Merged
miss-islington merged 12 commits into
python:mainfrom
tiran:bpo-45459-bufapi-struct
Feb 2, 2022
Merged

bpo-45459: Add Py_buffer to limited API#29991
miss-islington merged 12 commits into
python:mainfrom
tiran:bpo-45459-bufapi-struct

Conversation

@tiran

@tirantiran commented Dec 8, 2021

Copy link
Copy Markdown
Member
  • Py_buffer struct
  • PyBuffer_*() API functions
  • PyBUF_* constants
  • Py_bf_getbuffer and Py_bf_releasebuffer type slots
  • PyMemoryView_FromBuffer() API
  • tests for limited API
  • make regen-limited-abi
  • documentation update
  • export PyPickleBuffer*() API ???

https://bugs.python.org/issue45459

Automerge-Triggered-By: GH:encukou

@tiran
tiran requested a review from encukouDecember 8, 2021 14:12
@tirantiran mentioned this pull request Dec 8, 2021
3 tasks
@tiran
tiran marked this pull request as ready for review December 8, 2021 18:15
@tiran
tiran requested a review from a team as a code ownerDecember 8, 2021 18:15
@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actionsgithub-actionsBot added the stale Stale PR or inactive for long period of time. label Jan 8, 2022
@tiran
tiranforce-pushed the bpo-45459-bufapi-struct branch 2 times, most recently from a990f73 to 200d441CompareJanuary 13, 2022 10:40
@tirantiran removed the stale Stale PR or inactive for long period of time. label Jan 21, 2022
@tiran
tiranforce-pushed the bpo-45459-bufapi-struct branch 2 times, most recently from 1c41c9d to ef19458CompareJanuary 24, 2022 08:00
@tiran

Copy link
Copy Markdown
MemberAuthor

@encukou could you take a look, please?

@encukou

Copy link
Copy Markdown
Member

I'll get to it this week.

Comment threadDoc/data/stable_abi.dat Outdated
Comment threadInclude/buffer.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we leave out the bufferinfo tag? Anonymous structs are well-supported nowadays, and only Py_buffer should be public.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea!

Comment threadInclude/cpython/object.h Outdated
Comment threadModules/xxlimited.c Outdated
Comment threadModules/xxlimited.c Outdated
@tiran
tiranforce-pushed the bpo-45459-bufapi-struct branch from ef19458 to 6119c2bCompareFebruary 2, 2022 13:21
@tiran
tiran requested a review from encukouFebruary 2, 2022 14:40

@encukouencukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, let's get it in! Thanks!

@rdb

rdb commented Feb 7, 2022

Copy link
Copy Markdown

This change broke our project build because when cpython/object.h is including buffer.h it is forcing it to resolve along the search path, and the compiler is hitting the buffer.h in our project rather than the one in the Python include directory.

Should it not be using a relative include, ie. #include "../buffer.h" ? I think otherwise this change will cause breakage for many projects given how common the header name "buffer.h" may be.

@tiran

tiran commented Feb 7, 2022

Copy link
Copy Markdown
MemberAuthor

This PR is merged and closed. Please discuss this issue on the Python bug tracker.

@pythonpython locked as resolved and limited conversation to collaborators Feb 7, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@tiran@encukou@rdb@the-knights-who-say-ni@bedevere-bot@miss-islington