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.

classification
Title: Backport memoryview object to Python 2.7
Type: enhancement Stage: patch review
Components: Interpreter Core Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: pitrou Nosy List: akuchling, benjamin.peterson, brett.cannon, pitrou, teoliphant, theller
Priority: critical Keywords: patch

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:32adminsetgithub: 46648
2009-04-02 21:21:31pitrousetstatus: open -> closed
resolution: fixed
messages: + msg85267
2009-03-13 22:52:49pitrousetfiles: + memview-trunk3.patch

messages: + msg83540
2009-02-21 21:15:37benjamin.petersonsetmessages: + msg82585
2009-01-10 19:52:17pitrousetfiles: + memview-trunk2.patch
messages: + msg79570
2009-01-10 19:38:31thellersetnosy: + theller
2009-01-10 17:38:18pitrousetfiles: + memview-trunk.patch
title: Backport memoryview object to Python 2.6 -> Backport memoryview object to Python 2.7
messages: + msg79559
assignee: pitrou
keywords: + patch
stage: patch review
2008-08-05 14:29:41pitrousetpriority: release blocker -> critical
messages: + msg70741
2008-08-05 14:14:29benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg70738
versions: + Python 2.7, - Python 2.6
2008-08-04 18:30:16pitrousetnosy: + pitrou
messages: + msg70711
2008-08-04 18:26:26akuchlingsetnosy: + akuchling
messages: + msg70710
2008-08-03 01:45:10brett.cannonsetpriority: release blocker
nosy: + brett.cannon
messages: + msg70648
2008-03-18 16:02:42teoliphantcreate