This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kermode
Recipients jcon, kermode, mark.dickinson, ncoghlan, petri.lehtinen, pitrou, pv, rupole, skrah, teoliphant
Date 2011-06-27.18:14:36
SpamBayes Score 1.777436e-10
Marked as misclassified No
Message-id <4E08C885.1020209@telus.net>
In-reply-to <1309180676.88.0.541176207355.issue10181@psf.upfronthosting.co.za>
Content
Using Python reference counting and the garbage collector to control 
when PyBuffer_Release is called has problems. First, it assumes the 
CPython interpreter will always use reference counting. Second, 
PyBuffer_Release may never get called if circular references exist. 
Third, an exception could keep a memoryview object alive in a traceback, 
delaying the PyBuffer_Release call. Finally, it does not play well with 
the memoryview __enter__, __exit__, and release methods. It makes Python 
level context management pointless; instead, just del the memoryview 
instance and hope the garbage collector cooperates. For the old buffer 
protocol and the Numpy array interface, resources have to be released in 
an object's destructor at garbage collection time. There is no other 
choice. If that also becomes the case for the new buffer protocol, then 
there is little incentive to migrate to it.
History
Date User Action Args
2011-06-27 18:14:37kermodesetrecipients: + kermode, teoliphant, mark.dickinson, ncoghlan, rupole, pitrou, pv, skrah, jcon, petri.lehtinen
2011-06-27 18:14:36kermodelinkissue10181 messages
2011-06-27 18:14:36kermodecreate