Steven Bethard wrote:

I promised I'd put together a PEP for a 'generic object' data type for Python 2.5 that allows one to replace __getitem__ style access with dotted-attribute style access (without declaring another class). Any comments would be appreciated!

IMHO this too easy to accomplish right now to warrant an "official" implementation:

class Bunch:
    pass

b = Bunch()
b.one, b.two, b.three = 1,2,3

works just fine, depending on the problem I might add a few special
operators. For anything more complicated I'd rather write a real class.

Istvan.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to