how do i create such a thing?

Lowell Kirsh lkirsh at
Sun Jan 30 16:54:38 EST 2005

I want to create a class called DefaultAttr which returns a default 
value for all attributes which haven't been given values yet. It will 
work like this:

 >> x = DefaultAttr(99)
 >> print
 >> print
 >> = 7
 >> print

I already have a similar class called DefaultDict which works similarly 
which I assume would be a good thing to use.


More information about the Python-list mailing list