confused about resizing array in Python

Gabriel Genellina gagsl-py at yahoo.com.ar
Mon Feb 5 18:46:32 EST 2007


En Sat, 03 Feb 2007 21:34:19 -0300, Dongsheng Ruan <ruan at jcmills.com>  
escribió:

> This seems to be  clever to use reference for list.
>
> Is it unique to Python?
>
> How about the traditional programming languages like C, Pascal or C++?

Python is written in C - so obviously it can be done in plain C.
Delphi (Pascal) has a similar thing; lists hold only a reference to the  
object, and grow in discrete steps when needed.
And in C++ you have several container variants in the STL to choose from.
In all cases, there is a library behind, and a fairly good amount of code.  
The good news is that it's already done for python: you get a lot of data  
structures ready to use in Python.

-- 
Gabriel Genellina




More information about the Python-list mailing list