1class HauntedMansion:
2
3 def __init__(self, **kwargs):
4 for key, value in kwargs.items():
5 setattr(self, key, value)
6
7 def __getattr__(self, arg):
8 return "Booooo, only ghosts here!"
9
10 def __getattribute__(self, spooky_arg_name):
11 if spooky_arg_name.startswith('__'):
12 return object.__getattribute__(self, spooky_arg_name)
13
14 if spooky_arg_name.startswith('spooky_'):
15 return object.__getattribute__(self, spooky_arg_name[len('spooky_'):])
16
17 return "Booooo, only ghosts here!"
.
----------------------------------------------------------------------
Ran 1 test in 0.000s
OK