[Python-Dev] PEP 298

Jack Jansen Jack.Jansen@cwi.nl
Fri, 13 Dec 2002 13:33:16 +0100


On Thursday, Dec 12, 2002, at 20:10 Europe/Amsterdam, Guido van Rossum 
wrote:
>> If you call YAGNI, it's ok for me, that's why I'm asking. Better save
>> the time in this case...
>
> Well, I have no personal need for it.  If you're the only one, that
> sounds like a big YAGNI to me...

Well... Note that you are currently living dangerously if you're using 
an s# format and access that buffer again after a 
Py_BEGIN_ALLOW_THREADS. If the object passed from Python was a mutable 
object with a buffer interface there's a chance that another thread has 
moved the underlying data.

The PyArg_Parse replacement I would like to do (for which I have had, 
unfortunately, absolutely no support up to now, and which I don't feel 
up to designing all by myself) could fix this with PEP298: it would use 
the locked buffer interface if available on the object, and release the 
locked buffer after your method returns.
--
Jack Jansen, <Jack.Jansen@cwi.nl>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma 
Goldman