Little class that does restrictions/checks on adding to a list (simply
subclass and put your restrictions in the beforeAdd or beforeMultipleAdd
methods).
http://pytable.sourceforge.net/pydoc/basictypes.rlist.html
http://cvs.sourceforge.net/viewcvs.py/basicproperty/properties/basictypes/rlist.py?
The array module allows you to specify a single type of elements.
Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
ankit wrote:
> Is it possible to limit the size of list in python.
> I want to make list of 5 elements. How can I achieve this thing in
> python. And one more thing can we declare list to store elements of
> same type as in c, C++ we can declare an
> array which can have 5 elements of type int.
>
gene tani wrote:
> ankit wrote:
> > Is it possible to limit the size of list in python.
> > I want to make list of 5 elements. How can I achieve this thing in
> > python. And one more thing can we declare list to store elements of
> > same type as in c, C++ we can declare an
> > array which can ha
ankit wrote:
> Is it possible to limit the size of list in python.
> I want to make list of 5 elements. How can I achieve this thing in
> python. And one more thing can we declare list to store elements of
> same type as in c, C++ we can declare an
> array which can have 5 elements of type int.
>
Is it possible to limit the size of list in python.
I want to make list of 5 elements. How can I achieve this thing in
python. And one more thing can we declare list to store elements of
same type as in c, C++ we can declare an
array which can have 5 elements of type int.
C, C++:
int intarr[5]