[Python-Dev] State of PEP-3118 (memoryview part)
Terry Reedy
tjreedy at udel.edu
Thu Mar 1 02:48:37 CET 2012
[erroneouly hit send button before instead of edit menu above it]
On 2/29/2012 2:34 PM, Stefan Krah wrote:
> Greg Ewing<greg.ewing at canterbury.ac.nz> wrote:
>>> Options 2) and 3) would ideally entail one backwards
>>> incompatible bugfix: In 2.7 and 3.2 assignment to a memoryview
>>> with format 'B' rejects integers but accepts byte objects, but
>>> according to the struct syntax mandated by the PEP it should be
>>> the other way round.
If implementation and PEP conflict, the normal question is 'what does
the doc say?' as doc takes precedent over PEP. However, in this case the
'MemoryView objects' section under 'Concrete objects' says nothing about
the above that I could see and refers to Buffer Protocal in Abstract
Objects Layer. I did not see anything there either, but could have
missed it.
>> Maybe a compromise could be made to accept both in the backport?
>> That would avoid breaking old code while allowing code that does
>> the right thing to work.
This looks a bit like an enhancement ;-)
> This could definitely be done. But backporting is beginning to look
> unlikely, since we currently have three +1 for "too complex to
> backport".
My comment was more 'unnecessary to backpart'. This is based on the
following thoughts (which could have mistakes).
* I do not see enough benefit that I could wish you to write or anyone
else to review a bugfix patch. I would in no way stop you if this
continue to itch you ;-).
* Sorting out bugfix changes from feature looks complex and possibly
contentious and might take some time to discuss.
* 3.2.3 is, I presume, less than a month away, and if that is missed,
the next and last bugfix will be 3.2.4 at about the same time as 3.3.0.
At that time, the full new memoryview version would be a better target.
* As for porting, my impression is that the PEP directly affects only C
code and Python code using ctypes and only some fraction of those. If
the bugfix-only patch is significantly different from complete patch,
porting to 3.2 would be significantly different from porting to 3.3. So
I can foresee a temptation to just port to 3.3 anyway.
> I'm not strongly in favor of backporting myself. The main reason for
> me would be to prevent having additional 2->3 or 3->2 porting
> obstacles.
--
Terry Jan Reedy
More information about the Python-Dev
mailing list