mirror of
https://github.com/python/cpython.git
synced 2025-09-15 21:26:04 +00:00
Backport PEP 3141 from the py3k branch to the trunk. This includes r50877 (just
the complex_pow part), r56649, r56652, r56715, r57296, r57302, r57359, r57361, r57372, r57738, r57739, r58017, r58039, r58040, and r59390, and new documentation. The only significant difference is that round(x) returns a float to preserve backward-compatibility. See http://bugs.python.org/issue1689.
This commit is contained in:
parent
27edd829d7
commit
2f3c16be73
21 changed files with 1089 additions and 124 deletions
|
@ -358,7 +358,7 @@ class TestCase:
|
|||
Note that decimal places (from zero) are usually not the same
|
||||
as significant digits (measured from the most signficant digit).
|
||||
"""
|
||||
if round(second-first, places) != 0:
|
||||
if round(abs(second-first), places) != 0:
|
||||
raise self.failureException, \
|
||||
(msg or '%r != %r within %r places' % (first, second, places))
|
||||
|
||||
|
@ -370,7 +370,7 @@ class TestCase:
|
|||
Note that decimal places (from zero) are usually not the same
|
||||
as significant digits (measured from the most signficant digit).
|
||||
"""
|
||||
if round(second-first, places) == 0:
|
||||
if round(abs(second-first), places) == 0:
|
||||
raise self.failureException, \
|
||||
(msg or '%r == %r within %r places' % (first, second, places))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue