Possible Duplicate:
Accessing dict keys like an attribute in Python?
Is there a way to implement this in python
foo = {'test_1': 1,'test_2': 2}
print foo.test_1
>>> 1
Maybe if I extend dict, but I do not know how to dynamically generate functions.