>>> >>> class super_list(list): >>> pass >>> >>> def kwadraat ( value ) : >>> return value * value >>> >>> x={} >>> x['frequency']=33 >>> x['functie']=kwadraat >>> print x['functie'](2) >>> >>> y = super_list() >>> y.frequency = 33 >>> y.functie = kwadraat >>> print y.functie(3) >>> >> >> You don't use y as a list at all - you might as well inherit from >> object. > Good point, didn't notice that. Sorry, not a good point, by deriving from a list, I get all the list methods for nothing.
cheers, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list