Limiting the size of List and making it Homogeneous
gene tani
gene.tani at gmail.com
Fri Jan 13 04:12:09 EST 2006
More information about the Python-list mailing list
Fri Jan 13 04:12:09 EST 2006
- Previous message (by thread): Limiting the size of List and making it Homogeneous
- Next message (by thread): Limiting the size of List and making it Homogeneous
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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. > C, C++: > int intarr[5] > How can I achieve this kind of behavior ? > > Thanks - ring(circular) buffers overwrite oldest elements when they're flagged as at their limit, is that what you want?: http://www.onlamp.com/lpt/a/5828 you can write whatever type checks you want in the append() methods
- Previous message (by thread): Limiting the size of List and making it Homogeneous
- Next message (by thread): Limiting the size of List and making it Homogeneous
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list