[Python-Dev] Undocumented view==NULL argument in PyObject_GetBuffer()

Stefan Behnel stefan_ml at behnel.de
Tue Mar 6 13:50:37 CET 2012


Nick Coghlan, 06.03.2012 12:19:
> On Tue, Mar 6, 2012 at 8:34 PM, Stefan Krah wrote:
>> The obvious question is: Will anyone need view==NULL in the future or
>> can we remove the special case?
> 
> The public API will still need a guard (to report an error), but +1
> for otherwise eliminating the undocumented special case.

+1 for removing it internally and only checking at the API level.

I think it's just a left-over from the "old times" (pre 3.0) when the
buffer protocol had an explicit option to lock a buffer. Back then, the
code used to call into getbuffer() with a NULL pointer in order to acquire
the (IIRC write-) lock. It took me some discussion back then to get this
part of the protocol removed, but it's dead for good now.

Stefan



More information about the Python-Dev mailing list