setattr getattr confusion

Donn Ingle donn.ingle at gmail.com
Sat Dec 8 07:26:00 EST 2007


> So you might want to describe your use-case.
Um.. I wanted an object with Key to hold other data. I wanted a way to set
that *other* data within Key without having to specify the "object
in-between" everytime.

k1.x = "ni!"

should perform:
k1.props.x = "ni!"

and
print k1.x
should perform:
print k1.props.x


I'll go look at your link. Thanks.

\d   





More information about the Python-list mailing list