Skip to content

Recognize buffer protocol special methods#19581

Merged
JelleZijlstra merged 1 commit intopython:masterfrom
brianschubert:buffer-protocol-dunders
Aug 4, 2025
Merged

Recognize buffer protocol special methods#19581
JelleZijlstra merged 1 commit intopython:masterfrom
brianschubert:buffer-protocol-dunders

Conversation

@brianschubert
Copy link
Collaborator

The special methods __buffer__ and __release_buffer__ were added in Python 3.12. Both are implemented with slot descriptors, and so should be treated as being implicitly positional-only like other slot special methods.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2025

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@JelleZijlstra JelleZijlstra merged commit 0c922ce into python:master Aug 4, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants