classification
Title: [Py3k] Finish the memoryview object implementation
Type: behavior Stage: committed/rejected
Components: Interpreter Core Versions: Python 3.2
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Problems with Py_buffer management in memoryobject.c (and elsewhere?)
View: 10181
Assigned To: teoliphant Nosy List: belopolsky, benjamin.peterson, georg.brandl, gvanrossum, pitrou, r.david.murray, scoder, skrah, teoliphant
Priority: high Keywords: patch

Created on 2008-03-18 15:59 by teoliphant, last changed 2012-02-26 10:42 by skrah. This issue is now closed.

Messages (19)
msg63928 - (view) Author: Travis Oliphant (teoliphant) * (Python committer) Date: 2008-03-18 15:59
The memoryview object in Python 3.0 needs to be finished.  There are a
few methods that are not complete.  In particular, the __getitem__ and
__setitem__ functionality needs to be finished as well as the tolist()
method.
msg67429 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-05-27 20:31
Raising priority.
msg70406 - (view) Author: Stefan Behnel (scoder) * Date: 2008-07-29 17:46
Also, the implementation does not follow the revised buffer PEP 3118. It
still calls get/releasebuffer(NULL) to acquire a lock, which is no
longer allowed by the buffer protocol.

I think this should become a release blocker for the last beta.
msg70407 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-07-29 18:16
I agree, buffer interface should be completed before going into rc phase.
msg71165 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-08-15 09:38
See also #3560.
msg71412 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-08-19 12:39
Here is a preliminary patch implementing slices with getitem, adding a
bunch of tests, and fixing a few problems.

As stated elsewhere I only bother to test with simple byte buffers. The
semantics of other types of buffers are too fuzzy for me.
msg71415 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-08-19 13:08
Antoine, if this is a "cleanup", perhaps you could fix #3101 while
you're at it.
msg71419 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-08-19 14:24
Here is another patch with setitem too (integers and slices supported),
and further tests.
msg71423 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-08-19 15:16
This patch fixes a crash in the codecs module.
However, memoryview should also support comparisons (just == and !=)
with bytes/bytearray objects (or any buffer-enabled objects), otherwise
utf-8-sig produces wrong values (and there are no tests for it).
msg71428 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-08-19 15:38
Here is a patch to support comparisons of memoryview objects with other
objects offering the buffer interface. Two objects are equal if their
buffers have the same characteristics and compare equal bytewise.
It also improves the test in test_codecs.py, ensuring the problem has
been fixed.
msg71430 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-08-19 15:45
Adding some comparison tests.
msg71467 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-08-19 19:22
This patch changes all bytearray results (in indexing, tobytes()) to
bytes, and adds the implementation the tolist().

Note: the tolist() implementation only handles one-dimensional byte
buffers. It will have to be re-written using the struct module!
But at least once that patch applied, I think we may drop down this bug
to critical.
msg71469 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-08-19 19:26
Please review at http://codereview.appspot.com/3004
msg71493 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-08-19 22:11
Committed in r65886 after review from Benjamin and some small fixes.

I'm downgrading this to critical for the remains of the memoryview API
(support for more format types, multi-dimensional objects...). Perhaps
those remainings will have to wait for 3.1.
msg71736 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-08-22 09:51
Guido, do we retarget the rest of this to 3.1? It sounds more reasonable
to me.
msg71880 - (view) Author: Travis Oliphant (teoliphant) * (Python committer) Date: 2008-08-24 21:36
It would have been nice to finish the memoryview object for 3.0, but I
ran into time constraints.  The pieces that are left can be pushed to 3.1
msg71881 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-08-24 21:37
Great. It would be nice if you could at least do a quick review what has
been committed though.
msg123887 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-12-13 18:01
It looks to me like the critical parts of this have been done, so I'm downgrading the priority.
msg154324 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2012-02-26 10:42
I think this issue is now superseded by #10181 and #3132.
History
Date User Action Args
2012-02-26 10:42:35skrahsetstatus: pending -> closed
2012-02-26 10:42:23skrahsetstatus: open -> pending

superseder: Problems with Py_buffer management in memoryobject.c (and elsewhere?)

nosy: + skrah
messages: + msg154324
resolution: duplicate
stage: test needed -> committed/rejected
2010-12-13 18:01:16r.david.murraysetpriority: critical -> high
versions: + Python 3.2, - Python 3.1
nosy: + r.david.murray

messages: + msg123887
2010-05-28 04:14:26belopolskysetnosy: + belopolsky
2009-03-14 01:15:05pitrousetstage: test needed
2009-03-14 01:14:50pitrousetfiles: - mem1.patch
2009-03-14 01:14:33pitrousetfiles: - mem2.patch
2009-03-14 01:14:29pitrousetfiles: - mem3.patch
2009-03-14 01:14:26pitrousetfiles: - mem4.patch
2009-03-14 01:14:20pitrousetfiles: - mem5.patch
2009-03-14 01:14:14pitrousetfiles: - mem6.patch
2008-08-24 21:37:32pitrousetmessages: + msg71881
2008-08-24 21:36:51teoliphantsetversions: + Python 3.1, - Python 3.0
2008-08-24 21:36:31teoliphantsetmessages: + msg71880
2008-08-22 09:51:33pitrousetnosy: + gvanrossum
messages: + msg71736
2008-08-19 22:11:42pitrousetpriority: release blocker -> critical
messages: + msg71493
2008-08-19 19:26:31pitrousetmessages: + msg71469
2008-08-19 19:22:26pitrousetfiles: + mem6.patch
messages: + msg71467
2008-08-19 15:45:10pitrousetfiles: + mem5.patch
messages: + msg71430
2008-08-19 15:38:58pitrousetfiles: + mem4.patch
messages: + msg71428
2008-08-19 15:16:07pitrousetfiles: + mem3.patch
messages: + msg71423
2008-08-19 14:24:02pitrousetfiles: + mem2.patch
messages: + msg71419
2008-08-19 13:08:07benjamin.petersonsetmessages: + msg71415
2008-08-19 12:39:57pitrousetfiles: + mem1.patch
keywords: + patch
messages: + msg71412
2008-08-15 09:38:43pitrousetmessages: + msg71165
2008-08-14 02:40:06benjamin.petersonsetnosy: + benjamin.peterson
2008-08-11 18:28:08pitrousetnosy: + pitrou
2008-07-29 18:16:31georg.brandlsetpriority: critical -> release blocker
messages: + msg70407
2008-07-29 17:46:49scodersetnosy: + scoder
messages: + msg70406
2008-05-27 20:31:17georg.brandlsetpriority: critical
assignee: teoliphant
messages: + msg67429
nosy: + georg.brandl
2008-03-18 16:05:35teoliphantsettitle: Finish the memoryview object implementation -> [Py3k] Finish the memoryview object implementation
2008-03-18 15:59:47teoliphantcreate