Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
my.x.y.z = 3
print(my)
# subclass with existing property
class PropertyDotMap(MyDotMap):
def __init__(self, *args, **kwargs):
super(MyDotMap, self).__init__(*args, **kwargs)
self._myprop = MyDotMap({'nested': 123})
@property
def first(self):
return self._myprop
p = PropertyDotMap()
print(p.first)
print(p.first.nested)
p.first.second.third = 456
print(p.first.second.third)
# final print
print()