Concrete classes -- stylistic question
jdhunter at nitace.bsd.uchicago.edu
Thu Oct 10 18:43:16 CEST 2002
>>>>> "Andrew" == Andrew Koenig <ark at research.att.com> writes:
Andrew> Am I reinventing the wheel here? If so, where is the
Does you approach have anything substantive over the following?
foo = Record()
foo.x, foo.y = 3, 4
boo = Record()
boo.r, boo.theta = 1, 0.5
print boo.x #oops
Since your approach uses keyword args in Record, it doesn't seem like
you'll save any typing or clarity by using named keywords in the init
function rather than on the RHS of the tuple assignment.
Your __repr__ is a little prettier than printing __dict__, but no more
More information about the Python-list