Skip to content

Instantly share code, notes, and snippets.

View katyukha's full-sized avatar

Dmytro Katyukha katyukha

View GitHub Profile
class AttrDict(dict):
""" Simple class to make dictionary able to use attribute get operation
to get elements it contains using syntax like:
>>> d = AttrDict(arg1=1, arg2='hello')
>>> print d.arg1
1
>>> print d.arg2
hello
>>> print d['arg2']