Class or dictionary ? (was: class or inherited list ?)
stef.mientki at gmail.com
Fri Mar 28 22:48:05 CET 2008
although the code example was correct,
the question was wrong.
Stef Mientki wrote:
> Passing all kinds of data between objects,
> I'm looking for an elegant (and simple) way to pack the data.
> Now it looks to me that both the class and the inherited list,
> performs equally well.
> Till now, the most elegant way (in my view) is the list inheritance,
> mainly because you don't need brackets and no quotes.
> What are others opinion about this ?
> Stef Mientki
> class super_list(list):
> def kwadraat ( value ) :
> return value * value
> print x['functie'](2)
> y = super_list()
> y.frequency = 33
> y.functie = kwadraat
> print y.functie(3)
More information about the Python-list