[Python-ideas] pop multiple elements of a list at once (original) (raw)

Antoine Pitrou solipsis at pitrou.net
Mon Jul 12 14:59:56 CEST 2010


On Mon, 12 Jul 2010 22:45:10 +1000 Nick Coghlan <ncoghlan at gmail.com> wrote:

For the record, neither pymalloc nor the OS support breaking a chunk of already allocated memory in two that way - you need some master object to maintain control of it, and then use other pointers to look at subsections. Since memoryview objects in 3.x and 2.7 are designed specifically to provide a window onto a chunk of memory owned by another object (such as the storage underlying an array object) without copying, it seems like that is the kind of thing the original poster is actually looking for.

memoryviews don't provide a high-level view over their chunk of memory, though, only bytes-level. (they were specified to provide such a view, but it was never implemented)



More information about the Python-ideas mailing list