[pypy-dev] Arrays in rpython
santhosh.edukulla at gmail.com
Tue Jun 7 17:53:52 CEST 2011
Actually, there is also a module by name "Array"
Here t is a list and constrained more as an integer array.
Check docs for more help.
On 6/7/11, Maciej Fijalkowski <fijall at gmail.com> wrote:
> On Mon, Jun 6, 2011 at 8:54 PM, Timothy Baldridge <tbaldridge at gmail.com>
>>> In case you don't already know: in Python (and RPython), lists are
>>> implemented as
>>> resizeable arrays, i.e. they look more like a C++ std::vector and not
>>> a std::list.
>>> This said, IIRC RPython has special code for fixed-size lists.
>>> I think you just have to avoid all resizing functions.
>>> This means that the list must be created with statements like
>>> array_of_ints =  * 32
>>> array_of_objects = [None] * 32
>> Excellent! Exactly what I was looking for. Thanks.
> There is also pypy.rlib.debug.make_sure_not_resized which would make
> annotation explode if you by chance resize this list.
> pypy-dev mailing list
> pypy-dev at python.org
More information about the pypy-dev