Concrete classes -- stylistic question

Andrew Koenig ark at research.att.com
Thu Oct 10 14:01:37 EDT 2002


John> Does you approach have anything substantive over the following?

John> class Record:
John>    pass

John> foo = Record()
John> foo.x, foo.y = 3, 4

Yes:  It lets me write  f(Record(x=3, y=4))  instead of having to write

        temp = Record()
        temp.x, temp.y = 3, 4
        f(temp)

-- 
Andrew Koenig, ark at research.att.com, http://www.research.att.com/info/ark



More information about the Python-list mailing list