Author ncoghlan
Recipients kermode, loewis, mark.dickinson, ncoghlan, pitrou, pv, rupole, teoliphant
Date 2011-02-13.22:12:42
SpamBayes Score 2.66293e-08
Marked as misclassified No
Message-id <1297635165.41.0.851663838676.issue10181@psf.upfronthosting.co.za>
In-reply-to
Content
As far as the question of re-exporting the underlying view or not goes, I agree having "memoryview(a)" potentially refer to different underlying memory from "a" itself (because the source object has changed since the first view was exported) is a recipe for confusion. It is also important for ensuring memoryview slicing works correctly.

From a didactic point of view, this would also have the benefit of providing a canonical example of managing exported Py_buffer structs in the CPython source code.

The "repeated slicing" issue is definitely a concern, though. If we declare memoryview objects officially immutable, then we can avoid that by shortcutting the chaining with a typecheck on the referenced object (i.e. call GetBuffer on the source object directly if it is a memoryview, but on the memoryview we're copying otherwise)
History
Date User Action Args
2011-02-13 22:12:45ncoghlansetrecipients: + ncoghlan, loewis, teoliphant, mark.dickinson, rupole, kermode, pitrou, pv
2011-02-13 22:12:45ncoghlansetmessageid: <1297635165.41.0.851663838676.issue10181@psf.upfronthosting.co.za>
2011-02-13 22:12:42ncoghlanlinkissue10181 messages
2011-02-13 22:12:42ncoghlancreate