[pypy-dev] Arrays in rpython

Timothy Baldridge tbaldridge at gmail.com
Mon Jun 6 20:54:56 CEST 2011

> 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 = [0] * 32
>    array_of_objects = [None] * 32

Excellent! Exactly what I was looking for. Thanks.


“One of the main causes of the fall of the Roman Empire was
that–lacking zero–they had no way to indicate successful termination
of their C programs.”
(Robert Firth)

More information about the pypy-dev mailing list