click here to view source
The class ExpandingList uses the following design patterns:
list object (a python builtin). It overrides the accessor method such that it is not possible to return a null reference from a positive index access call.__default_object()) to build list elements when the list superclass requires expansion. Since the elements are built using only a dictionary and/or arbitrary parameter lists, the factory function is generic for any type of class. In this way, we use the Builder pattern, since the same construction process can create completely different class representations.