Linked lists (was Re: Typing system vs. Java

Alex Martelli aleaxit at yahoo.com
Tue Aug 7 03:17:03 EDT 2001


"Courageous" <jkraska1 at san.rr.com> wrote in message
news:fh0vmt8dl3qor2c0btvutvnk8t2atjndjl at 4ax.com...
>
> >I don't care if I had to explicitly express that I want linked list,
> >it just should be there. Or is the concept problematic in Python, for
> >some reason?
    ...
> If you have some special purpose linked list where N > 2000, it's
> easy enough to find an extension to fit your purposes. But as for
> the every day Python user, you have to admit that's a fairly special
> case. It therefore wouldn't be justified putting it into the language
> proper.

Absolutely, particularly since it's so easy to implement
in Python after all:

def cons(car, cdr):
    return car, cdr

def car(alist):
    return alist[0]

def cdr(alist):
    return alist[1]

There -- full fledged LISP-like lists.  What more could
one want?-)


Alex






More information about the Python-list mailing list