Issue 2396: Backport memoryview object to Python 2.7 (original) (raw)

Created on 2008-03-18 16:02 by teoliphant, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
memview-trunk.patch pitrou,2009-01-10 17:38
memview-trunk2.patch pitrou,2009-01-10 19:52
memview-trunk3.patch pitrou,2009-03-13 22:52
Messages (11)
msg63930 - (view) Author: Travis Oliphant (teoliphant) * (Python committer) Date: 2008-03-18 16:02
The memoryview object in Python 2.6 would help in the transition to Python 3.0. It is a lower-priority and could wait until 2.7 if it doesn't get finished.
msg70648 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2008-08-03 01:45
But the warning in 2.6 for buffer() says to use memoryview(), which does not exist. So either the backport needs to happen in 2.6 or the warning needs to go away for generic buffer() usage and instead be changed to only occur when the 2to3 fixer won't work (which, I am guessing, is only needed when more than one argument to buffer() is used).
msg70710 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2008-08-04 18:26
Is there still time to do the backport for 2.6 at this late date?
msg70711 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-08-04 18:30
Not only there may not be enough time, but: 1. the memoryview implementation itself is not finished (that is, in py3k) 2. polishing and documenting the buffer API is more important 3. there doesn't seem to be any use for memoryview objects right now So, IMO, this can be re-targeted to 2.7.
msg70738 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-08-05 14:14
I concur.
msg70741 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-08-05 14:29
Not a release blocker then :-)
msg79559 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-01-10 17:38
Here is a patch. Some remarks: - I had to disable a few tests in test_memoryview.py, mainly because array.array does not support the new buffer API in 2.x - I kept the PyBytes_* aliases in memoryobject.c rather than using the PyString_* equivalents. Is it ok? - I didn't update the Windows build files, I suppose someone else can do it (I'm unable to do it myself) - I'm not sure about the tp_flags juggling in typeobject.c, my additions may be redundant (although very lightweight)
msg79570 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-01-10 19:52
This new patch includes documentation update and fixes as well.
msg82585 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-02-21 21:15
Some comments: - PyBytes_* API is fine. - memory_str should die. - Py_TPFLAGS_HAVE_NEWBUFFER needs to be documented. Otherwise it looks good.
msg83540 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-03-13 22:52
Here is an updated patch removing memory_str. I know Py_TPFLAGS_HAVE_NEWBUFFER should be documented, but I'm not sure where and how (I didn't add it in the first place).
msg85267 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-04-02 21:21
Committed in r71070.
History
Date User Action Args
2022-04-11 14:56:32 admin set github: 46648
2009-04-02 21:21:31 pitrou set status: open -> closedresolution: fixedmessages: +
2009-03-13 22:52:49 pitrou set files: + memview-trunk3.patchmessages: +
2009-02-21 21:15:37 benjamin.peterson set messages: +
2009-01-10 19:52:17 pitrou set files: + memview-trunk2.patchmessages: +
2009-01-10 19:38:31 theller set nosy: + theller
2009-01-10 17:38:18 pitrou set files: + memview-trunk.patchtitle: Backport memoryview object to Python 2.6 -> Backport memoryview object to Python 2.7messages: + assignee: pitroukeywords: + patchstage: patch review
2008-08-05 14:29:41 pitrou set priority: release blocker -> criticalmessages: +
2008-08-05 14:14:29 benjamin.peterson set nosy: + benjamin.petersonmessages: + versions: + Python 2.7, - Python 2.6
2008-08-04 18:30:16 pitrou set nosy: + pitroumessages: +
2008-08-04 18:26:26 akuchling set nosy: + akuchlingmessages: +
2008-08-03 01:45:10 brett.cannon set priority: release blockernosy: + brett.cannonmessages: +
2008-03-18 16:02:42 teoliphant create