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 scoder
Recipients benjamin.peterson, dw, hynek, pitrou, scoder, serhiy.storchaka, stutzbach
Date 2014-07-18.08:42:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1405672952.58.0.29807572761.issue22003@psf.upfronthosting.co.za>
In-reply-to
Content
Even if there is no way to explicitly request a RO buffer, the Py_buffer struct that you get back actually tells you if it's read-only or not. Shouldn't that be enough to enable this optimisation?

Whether or not implementors of the buffer protocol set this flag correctly is another question, but if not then they need fixing on their side anyway. (And in the vast majority of cases, the implementor will be either CPython or NumPy.)

Also, generally speaking, I think such an optimisation would be nice, even if it only catches some common cases (and doesn't break the others :). It could still copy data if necessary, but try to avoid it if possible.
History
Date User Action Args
2014-07-18 08:42:32scodersetrecipients: + scoder, pitrou, benjamin.peterson, stutzbach, hynek, dw, serhiy.storchaka
2014-07-18 08:42:32scodersetmessageid: <1405672952.58.0.29807572761.issue22003@psf.upfronthosting.co.za>
2014-07-18 08:42:32scoderlinkissue22003 messages
2014-07-18 08:42:32scodercreate