Nick Coghlan <ncoghlan at gmail.com> wrote: > 2. the current check is too strict (it should just check for obj != > NULL, not obj == &exporter) Yes. For anyone who is interested, see issue #14181. > 3. the current check is in the wrong place (it should be in PyObject_GetBuffer) Agreed, since it's not memoryview specific. But I don't think we even need to check for obj != NULL. view.obj was undocumented, and since 3.0 Include/object.h contains this: typedef struct bufferinfo { void *buf; PyObject *obj; /* owned reference */ So it would be somewhat audacious to set this field to NULL. But even if existing code uses the view.obj==NULL scheme from PyBuffer_FillInfo() correctly, it will still work in the new implementation. I'd just prefer to forbid this in the documentation, because it's much easier to remember: getbuffer "returns" a new reference or NULL. Stefan Krah
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4