Concrete classes -- stylistic question

Andrew Koenig ark at research.att.com
Thu Oct 10 13:57:34 EDT 2002


Aahz> You can also do the dirt-simple:

Aahz>     class xy: pass
Aahz>     class rtheta: pass

Aahz>     foo = xy(); foo.x,foo.y = 1,2

Aahz> I'm not recommending this, of course.  You can also do the even more
Aahz> dirt-simple:

Aahz>     class Record: pass

Aahz>     foo = Record(); foo.x,foo.y = 1,2

Aahz> It all depends on where you want your complexity to lie.

Understood.

I was looking for a more compact notation for constructing
such objects.

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



More information about the Python-list mailing list