Bo Peng <[EMAIL PROTECTED]> wrote:
...
> Thank again for everyone's help. I have learned a lot from the posts,
> especially the wrapdict class.
Hmmm, you do realize that wrapdict uses a lot of indirection while my
equivalent approach, just posted, is very direct, right? To reiterate
the latter, and dress it up nicely too, it's
class wrapwell(object):
def __init__(self, somedict):
self.__dict__ = somedict
and use d=wrapwell(whateverdict) to make the wrapper. Now, reading or
writing d.x is just like reading or writing whateverdict['x'], etc etc.
Alex
--
http://mail.python.org/mailman/listinfo/python-list