Martin Drautzburg <[EMAIL PROTECTED]> wrote: > > mydata = data( ) > > mydata.foo = 'foo' > > mydata.bar = 'bar' > > > > print mydata.foo > > print mydata.bar > > I am aware of all this. > Okay let me rephrase my question: is there a way of using dot notation > without having to create a class?
Sure, all you need to create is an *INSTANCE* of a suitable type or class. For example: >>> d = dict(foo=23, bar=45) >>> m = new.module('for_martin') >>> m.__dict__.update(d) >>> m.foo 23 >>> m.bar 45 >>> A module may be appropriate, since it's little more than a "wrapper around a dict to access items by dot notation":-). Alex -- http://mail.python.org/mailman/listinfo/python-list