Advantage of the array module over lists?

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Sun Mar 16 10:26:11 EDT 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
operations.

Bye,
bearophile



More information about the Python-list mailing list