aboutsummaryrefslogtreecommitdiff
path: root/gn3/utility/bunch.py
diff options
context:
space:
mode:
Diffstat (limited to 'gn3/utility/bunch.py')
-rw-r--r--gn3/utility/bunch.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/gn3/utility/bunch.py b/gn3/utility/bunch.py
new file mode 100644
index 0000000..c1fd907
--- /dev/null
+++ b/gn3/utility/bunch.py
@@ -0,0 +1,16 @@
+"""module contains Bunch class a dictionary like with object notation """
+
+from pprint import pformat as pf
+
+
+class Bunch:
+ """Like a dictionary but using object notation"""
+
+ def __init__(self, **kw):
+ self.__dict__ = kw
+
+ def __repr__(self):
+ return pf(self.__dict__)
+
+ def __str__(self):
+ return self.__class__.__name__