mirror of
https://github.com/python/cpython.git
synced 2025-10-27 03:34:32 +00:00
Revert r82044, since it changed the semantics of negated imaginary literals.
Before r82044, '-7j' became complex(0.0, -7.0); afterwards it was complex(-0.0, -7.0). See issue 9011.
This commit is contained in:
parent
881c1b4c10
commit
ce5b6c43bf
3 changed files with 26 additions and 15 deletions
|
|
@ -479,16 +479,6 @@ def test_compile_badunicode(self):
|
|||
st = parser.suite('a = "\\u1"')
|
||||
self.assertRaises(SyntaxError, parser.compilest, st)
|
||||
|
||||
def test_issue_9011(self):
|
||||
# Issue 9011: compilation of an unary minus expression changed
|
||||
# the meaning of the ST, so that a second compilation produced
|
||||
# incorrect results.
|
||||
st = parser.expr('-3')
|
||||
code1 = parser.compilest(st)
|
||||
self.assertEqual(eval(code1), -3)
|
||||
code2 = parser.compilest(st)
|
||||
self.assertEqual(eval(code2), -3)
|
||||
|
||||
class ParserStackLimitTestCase(unittest.TestCase):
|
||||
"""try to push the parser to/over its limits.
|
||||
see http://bugs.python.org/issue1881 for a discussion
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue