On 11/1/06, Alexander Belopolsky <alexander.belopolsky at gmail.com> wrote: > Let's just start with that. The way I see the problem is that buffer protocol > is fine as long as your data is an array of bytes, but if it is an array of > doubles, you are out of luck. So, while I can do > > >>> b = buffer(array('d', [1,2,3])) > > there is not much that I can do with b. For example, if I want to pass it to > numpy, I will have to provide the type and shape information myself: > > >>> numpy.ndarray(shape=(3,), dtype=float, buffer=b) > array([ 1., 2., 3.]) > > With the extended buffer protocol, I should be able to do > > >>> numpy.array(b) As a data point, this is the first posting that has clearly explained to me what the two PEPs are attempting to achieve. That may be my blindness to what others find self-evident, but equally, I may not be the only one who needed this example... Paul.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4