gh-119594: Improve pow(fraction.Fraction(), b, modulo) error message (#119593)
If one calls pow(fractions.Fraction, x, module) with modulo not None, the error message now says that the types are incompatible rather than saying pow only takes 2 arguments. Implemented by having fractions.Fraction __pow__ accept optional modulo argument and return NotImplemented if not None. pow() then raises with appropriate message. --------- Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
W
Wim Jeantine-Glenn committed
fcca08ec2f48f4ba5ba1d4690fb39b1efe630944
Parent: bf4ff3a
Committed by GitHub <noreply@github.com>
on 5/29/2024, 5:46:20 PM