gh-130104: Call __rpow__ in ternary pow() if necessary (GH-130251)

Previously it was only called in binary pow() and the binary
power operator.
This commit is contained in:
Serhiy Storchaka 2025-04-16 18:32:41 +03:00 committed by GitHub
parent 72da4a4458
commit 62ff86fa55
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 74 additions and 18 deletions

View file

@ -1707,6 +1707,12 @@ class FractionTest(unittest.TestCase):
self.assertRaisesMessage(TypeError,
message % ("Fraction", "int", "int"),
pow, F(3), 4, 5)
self.assertRaisesMessage(TypeError,
message % ("int", "Fraction", "int"),
pow, 3, F(4), 5)
self.assertRaisesMessage(TypeError,
message % ("int", "int", "Fraction"),
pow, 3, 4, F(5))
if __name__ == '__main__':