mirror of https://github.com/python/cpython
Browse Source
Make mixed-type `%` and `//` operations involving `Fraction` and `float` objects behave like all other mixed-type arithmetic operations: first the `Fraction` object is converted to a `float`, then the `float` operation is performed as normal. This fixes some surprising corner cases, like `Fraction('1/3') % inf` giving a NaN.
Thanks Elias Zamaria for the patch.
pull/9050/head
committed by
Mark Dickinson
4 changed files with 13 additions and 12 deletions
Loading…
Reference in new issue