New to Python - Compiled Language?

Hannu Kankaanp?? hanzspam at yahoo.com.au
Wed Nov 5 04:04:15 EST 2003


"Michael Geary" <Mike at DeleteThis.Geary.com> wrote in message news:<vqgq0u8vn0dd44 at corp.supernews.com>...
> > Also, can Python support Linked Lists? I believe someone said in one
> > of the other emails that Python doesn't support pointers.
> 
> Lists are a native Python type. They're one of the things it does best--you
> don't need to implement linked lists yourself with pointers.

But Python's lists aren't linked lists. They're resizing arrays (like
std::vector in c++), confusingly called lists. The speed differences
are in inserting and deleting from the middle of the list, and
random access.

Anyway, one could say that Python's variables are pointers but they
just don't support pointer arithmetic (like adding 1 to the pointer
so that it'll refer to the next memory location). So many variables
can point to the same object, and implementing a linked list is possible.




More information about the Python-list mailing list