aboutsummaryrefslogtreecommitdiff
path: root/gn3/utility/bunch.py
blob: c1fd907031f3f8a96f2bb38c1a5ebc2d0d53d13b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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__