Advantage of the array module over lists?

bearophileHUGS at bearophileHUGS at
Sun Mar 16 15:26:11 CET 2008

Their efficiency is mostly regarding the space. I think they aren't
much speed-efficient because they require many conversions from-to
Python types.
You can gain speed efficiency too (sometimes a LOT), in some
situations, using array with Psyco.
Another advantage of arrays (better called "vector"s, probably, so the
name "array" can replace the "list" name used by the built in) is that
they offer you a fixed size representation, so you know what you are
working with.
You can also take a look at the C version of the BList from
cheeseshop, the autor has made them rather efficient for some kinds of


More information about the Python-list mailing list