[Python-Dev] State of PEP-3118 (memoryview part) (original) (raw)

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'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