This one is out of the Python Cookbook and credit goes to Alex Martelli if I'm not mistaken. This technique is useful when we would like to record data in some type of "forgiving" data structure.
We know we can accomplish this with a python dictionary, but what about when we want to nest an inconsistent data structure in another inconsistent data structure? This is when the bunch pattern is useful.
def __init__(self, *args, **kwargs):
struct = Bunch(type="flat", size="huge", family="chordata", genus=Bunch(level="medium", intensity="hot"), BOOL=True)
<__main__ .bunch=".bunch" 0x1004e1248="0x1004e1248" at="at" instance="instance">
Pretty slick, huh? The beauty of this vignette is that it is highly extensible. The original thread where I stumbled upon this is located here.