cpython icon indicating copy to clipboard operation
cpython copied to clipboard

gh-119189: Fix the fraction module so that __rpow__ works on arbitrary classes.

Open zitterbewegung opened this issue 1 year ago • 0 comments

gh-119189: Fix the fraction module so that rpow works on arbitrary classes.

 The fraction module implicitly casted float if __rpow__ was implemented in your class when raising a fraction to a power. Now we replace the cast to float and instead check if it is a float or complex  and if the class isn't it will raise an exception.

zitterbewegung avatar May 20 '24 18:05 zitterbewegung