On Wed, 5 Jan 2011 12:55:55 +0000 Mark Dickinson <dicki...@gmail.com> wrote: > On Wed, Jan 5, 2011 at 12:31 PM, Nick Coghlan <ncogh...@gmail.com> wrote: > > Currently [1], the implementation and the documentation for PEP 3118's > > Py_buffer struct don't line up (there's an extra field in the > > implementation that the PEP doesn't mention). > > I think there are actually two such fields: smalltable and obj. > > The need for obj is a little ugly: as far as I can tell, it's > meaningless for a 3rd-party object that wants to export buffers---it's > only really used by the memoryview object and by internal Python > types.
I don't think it's ugly. It's the only way to know which object exported a Py_buffer. Otherwise you have to track the information separately, which is quite a bit uglier (especially when in conjunction with PyArg_ParseTuple and friends). Regards Antoine. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com