I would like to inherit from list to produce the myList
class, that ony accepts one specific type of object (say ints).
I am sure decorators can do that elegantly.
Thanks
I would like to inherit from list to produce the myList
class, that ony accepts one specific type of object (say ints).
I am sure decorators can do that elegantly.
Thanks
What about using arrays?
This module defines an object type which can compactly represent an array of basic values: characters, integers, floating point numbers. Arrays are sequence types and behave very much like lists, except that the type of objects stored in them is constrained. The type is specified at object creation time by using a type code, which is a single character. The following type codes are defined: