class documentation
class AttrDict(dict): (source)
Known subclasses: nltk.corpus.reader.framenet.PrettyDict
Constructor: AttrDict(*args, **kwargs)
A class that wraps a dict and allows accessing the keys of the dict as if they were attributes. Taken from here: http://stackoverflow.com/a/14620633/8879 >>> foo = {'a':1, 'b':2, 'c':3} >>> bar = AttrDict(foo) >>> pprint(dict(bar)) {'a': 1, 'b': 2, 'c': 3} >>> bar.b 2 >>> bar.d = 4 >>> pprint(dict(bar)) {'a': 1, 'b': 2, 'c': 3, 'd': 4}
Method | __getattr__ |
Undocumented |
Method | __getitem__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | __setattr__ |
Undocumented |
Method | __str__ |
Undocumented |
Method | _short |
Undocumented |
Method | _str |
Undocumented |