1class HauntedMansion:
2
3 def __init__(self, **kwargs):
4 for name, value in kwargs.items():
5 setattr(self, name, value)
6
7 def __setattr__(self, name, value):
8 object.__setattr__(self, 'spooky_' + name, value)
9
10 def __getattr__(self, item):
11 return 'Booooo, only ghosts here!'
.
----------------------------------------------------------------------
Ran 1 test in 0.000s
OK