[issue17145] memoryview(array.array)
Roundup Robot added the comment: New changeset 0a2ac61729d2 by Stefan Krah in branch '2.7': Issue #17145: Document array.array buffer interface limitations. http://hg.python.org/cpython/rev/0a2ac61729d2 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17145 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17145] memoryview(array.array)
Stefan Krah added the comment: I pushed a minimal patch that focuses on the array.array issue. For broader changes, I suggest to use #14198 (though it is unlikely tha anyone will work on it). -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17145 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17145] memoryview(array.array)
Changes by Paul Sokolovsky pfal...@users.sourceforge.net: -- nosy: +pfalcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17145 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17145] memoryview(array.array)
Changes by mpb mpb.m...@gmail.com: -- nosy: +mpb ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17145 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17145] memoryview(array.array)
Stefan Krah added the comment: The request is certainly valid, but the patch is tricky to review. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17145 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17145] memoryview(array.array)
Demian Brecht added the comment: Bump. If the patch (or request) is invalid, might be worthwhile closing this issue (although I still think it's valid ;)). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17145 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17145] memoryview(array.array)
Terry J. Reedy added the comment: I am looking at this as a naive user, and can only assume that the claims are correct. +The new C-level buffer API has been backported to Python 2.6 and the +Python-level :class:`memoryview` object has been backported to Python 2.7. +To be clear, in Python 2.6 and 2.7, there are two C-level interfaces, both +exposed by the :ctype:`PyBufferProcs` interface: the new buffer API and the +old buffer API. The :class:`memoryview` object is the product of the new API +while :class:`buffer` is the product of the old API (the former of which is +only available in 2.7+). This part strikes me as a bit jumbled. Is it necessary to discuss 2.6 in 2.7 docs? the last parenthetical comment repeats what was said in an earlier sentence. Benjamin, I am adding you because you are listed as an author of the section being revised. -- nosy: +benjamin.peterson, terry.reedy stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17145 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17145] memoryview(array.array)
Demian Brecht added the comment: Yes, I agree that passage is a little garbled. I've reworked that particular paragraph in the new patch. I had included a little information about 2.6 as it was in the revision prior to my patch (and there was also some historical context back to 1.6). I think that 2.6-specific information is irrelevant in this particular doc (after all, it's 2.7-specific and not a change log ;)) and therefore have removed it. -- Added file: http://bugs.python.org/file29128/buffer.1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17145 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17145] memoryview(array.array)
Demian Brecht added the comment: I've given this some more thought and quite a bit more work and reorganization. I think this clarifies the usage of memoryviews and buffers as well as the C-level API for each. This is my first run at contributing a patch of any sort, so please let me know if there's anything further needed or any changes are required (or I'm just right out to lunch with this). -- Added file: http://bugs.python.org/file29067/buffer.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17145 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17145] memoryview(array.array)
Demian Brecht added the comment: Here's a patch for the docs that adds a little clarity. -- keywords: +patch Added file: http://bugs.python.org/file28986/buffer.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17145 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17145] memoryview(array.array)
Demian Brecht added the comment: Strike that patch, this needs a little more love than during-my-first-coffee-of-the-day work. I'll work on it more and submit a follow-up for review. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17145 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17145] memoryview(array.array)
New submission from Demian Brecht: array.array doesn't implement the buffer interface in 2.7, so memoryviews cannot be applied to them. As memoryview has been backported to 2.7, array.array should be updated to support it. Either that, or the 2.7 documentation should be updated to reflect the lack of support for arrays in 2.7 (http://docs.python.org/2.7/c-api/buffer.html). python3 memoryview(array('I', [1,2,3,4])) memory at 0x109e46048 python memoryview(array('I', [1,2,3,4])) Traceback (most recent call last): File stdin, line 1, in module TypeError: cannot make memory view because object does not have the buffer interface -- components: None messages: 181541 nosy: Demian.Brecht priority: normal severity: normal status: open title: memoryview(array.array) type: enhancement versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17145 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17145] memoryview(array.array)
Stefan Krah added the comment: Changing array.array would be a new feature, so it cannot go into 2.7. The documentation could be improved, see also #14198. -- assignee: - docs@python components: +Documentation -None nosy: +docs@python, skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17145 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com