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