1def logic_mixin_factory(mass, mass_attr_name, material, material_attr_name, float_method_name):
2 class LogicMixin:
3 def is_a_witch(self):
4 if getattr(self, mass_attr_name, None) == mass or \
5 getattr(self, material_attr_name, None) == material or \
6 callable(getattr(self, float_method_name, None)):
7 return "Burn her!"
8
9 return "No, but it's a pity, cuz she looks like a witch!"
10
11 return LogicMixin
.
----------------------------------------------------------------------
Ran 1 test in 0.000s
OK
10.11.2023 16:18