bpo-36027: Extend three-argument pow to negative second argument (GH-13266)

This commit is contained in:
Mark Dickinson 2019-06-02 10:24:06 +01:00 committed by GitHub
parent 5ae299ac78
commit c52996785a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 173 additions and 16 deletions

View file

@ -1195,7 +1195,8 @@ class BuiltinTest(unittest.TestCase):
self.assertAlmostEqual(pow(-1, 0.5), 1j)
self.assertAlmostEqual(pow(-1, 1/3), 0.5 + 0.8660254037844386j)
self.assertRaises(ValueError, pow, -1, -2, 3)
# See test_pow for additional tests for three-argument pow.
self.assertEqual(pow(-1, -2, 3), 1)
self.assertRaises(ValueError, pow, 1, 2, 0)
self.assertRaises(TypeError, pow)