python list handling and Lisp list handling

Paul Rubin http
Fri Apr 24 12:17:30 EDT 2009


Mark Tarver <dr.mtarver at ukonline.co.uk> writes:
> But are Python lists also indistinguishable from conventional
> Lisplists for list processing.  For example, can I modify a Python
> list non-destructively?  Are they equivalent to Lisp lists. Can CAR
> and CDR in Lisp be thought of as

Python lists are vectors that automatically resize.  You can append to
the end in amortized constant time in the obvious way (i.e. the
implementation allocates some extra space for expansion, and copies to
an even bigger area if you run out of expansion room).  You can insert
and delete in the middle in linear time.  This isn't as bad as it
sounds because the Python interpreter is pretty slow, but the list
insertion/deletion primitives are in C and are fast.



More information about the Python-list mailing list