alternative python solution

My alternative class based python solution using __new__ and __call__