python Programming Glossary: dictobj
Javascript style dot notation for dictionary keys unpythonic? http://stackoverflow.com/questions/224026/javascript-style-dot-notation-for-dictionary-keys-unpythonic I've started to use constructs like these class DictObj object def __init__ self self.d def __getattr__ self m return.. self m v Update based on this thread I've revised the DictObj implementation to class dotdict dict def __getattr__ self attr.. c self.counter self.counter 1 return self.d c where DictObj is a dictionary that can be accessed via dot notation d DictObj..
|