Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __setattr__(self, k, v):
"""Recursive.
>>> x=AutoBunch()
>>> setattr(x, 'mega.name', 'xy')
"""
k2, _, k3 = k.partition('.')
if k3:
self.__getattr__(k2).__setattr__(k3, v)
else:
Munch.__setattr__(self, k, v)