Add __buffer__
and __release_buffer__
methods to builtin types
#5179
Labels
C-compat
A discrepancy between RustPython and CPython
Feature
The buffer protocol is mostly intended to provide provide a C API to access the underlying buffers of data structures like
bytes
,array
, andmemoryview
. In Python 3.12 two new methods,__buffer__
and__release_buffer__
, were added to allow subclasses and custom classes to interface with the C API.As far as I can tell RustPython does not support the C API, but the appropriate builtin types should still have these slots defined.
Python Documentation or reference to CPython source code
https://docs.python.org/3.12/reference/datamodel.html#emulating-buffer-types
https://peps.python.org/pep-0688/
The text was updated successfully, but these errors were encountered: