MemoryView missing from Python 2.4 and 2.6
Joel Brobecker
brobecker@adacore.com
Tue Mar 7 15:27:00 GMT 2017
> > It looks like the patch is also removing the feature from users of
> > Python 2.7.x, though, is it not?
>
> The patch (see
> https://sourceware.org/ml/gdb-patches/2017-03/msg00039.html) does not
> remove any feature. The patch changes the return type of one function
> from "memoryview" to "buffer" for Python 2.7 and below. Both types
> support the "in" keyword, indexed access, length etc. and behave very
> similar. Granted, memoryview has some additional functions that lets
> the user inspect the stride and size of the elements in the buffer,
> but this is a feature we do not use here anyway.
>
> I chose 2.7 as a parting point because that is how it is handled in
> infpy_read_memory in py-inferior.c. Personally, I would leave it that
> way because with "buffer" exposed with Python 2.7 as well as Python
> 2.6 and below, I guess it gets more exposure and testing and won't
> suffer bit-rot as easily.
>
> The patch is tested with Python 2.7 and Python 3.6. I cannot test it
> with Python 2.6 but that should not be necessary as these two versions
> already check both different return types.
OK, that seems sensible for me indeed. Thanks for taking the time
to explain!
--
Joel
More information about the Gdb-patches
mailing list