diff options
author | Jeffrey Yasskin <jyasskin@gmail.com> | 2007-09-07 15:15:49 (GMT) |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@gmail.com> | 2007-09-07 15:15:49 (GMT) |
commit | 3404b3ce2acfc550571f06e70526ff75a34effeb (patch) | |
tree | f0d59f10296397ed947e970af4fdb8179c5aeef1 /Lib/test/test_builtin.py | |
parent | aaaef110dcb58ded6257512997ddf270828dc409 (diff) | |
download | cpython-3404b3ce2acfc550571f06e70526ff75a34effeb.zip cpython-3404b3ce2acfc550571f06e70526ff75a34effeb.tar.gz cpython-3404b3ce2acfc550571f06e70526ff75a34effeb.tar.bz2 |
Check in some documentation tweaks for PEP 3141, add some tests, and implement
the promotion to complex on pow(negative, fraction).
Diffstat (limited to 'Lib/test/test_builtin.py')
-rw-r--r-- | Lib/test/test_builtin.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index d9633af..b6b45ee 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -1358,11 +1358,13 @@ class BuiltinTest(unittest.TestCase): else: self.assertAlmostEqual(pow(x, y, z), 24.0) + self.assertAlmostEqual(pow(-1, 0.5), 1j) + self.assertAlmostEqual(pow(-1, 1/3), 0.5 + 0.8660254037844386j) + self.assertRaises(TypeError, pow, -1, -2, 3) self.assertRaises(ValueError, pow, 1, 2, 0) self.assertRaises(TypeError, pow, -1, -2, 3) self.assertRaises(ValueError, pow, 1, 2, 0) - self.assertRaises(ValueError, pow, -342.43, 0.234) self.assertRaises(TypeError, pow) |