True lists in python?

Stefan Sonnenberg-Carstens stefan.sonnenberg at pythonmeister.com
Sun Dec 19 14:45:55 EST 2010


Am 19.12.2010 07:18, schrieb Dmitry Groshev:
> Is there any way to use a true lists (with O(c) insertion/deletion and
> O(n) search) in python? For example, to make things like reversing
> part of the list with a constant time.
reversing part of the list could also be interpreted as reading it
in the opposite direction from a given starting point to a known end.

Perhaps you want to look into the array module, but you
have to  sacrifice the typelessness of a true python list:
it can only contain numerical data (also char, byte).

But don't know the timing pattern of array objects, only that they are *way*
faster then lists.





More information about the Python-list mailing list