Special method to delegate PEP 3118 buffer access to another object?

Jan. 15, 2012
7:44 a.m.
I'm still working on fixing CPython's operand precedence bug for pure sequence types implemented in C [1], and, while trying to test bytearray, came across the problem that there doesn't appear to be a way to write a class in pure Python that redirects the PEP 3118 buffer access slots to another object (e.g. a memoryview instance or a bytes object). Did I miss something? And, if not, would it make sense to have the buffer retrieval operations look for a __buffer__ method in the type dictionary as a last resort if the relevant C level slots aren't provided? Cheers, Nick. [1] http://bugs.python.org/issue11477 -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia
4812
Age (days ago)
4812
Last active (days ago)
1 comments
2 participants
participants (2)
-
Antoine Pitrou
-
Nick Coghlan