Terry J. Reedy added the comment:
The absence of a space is intentional. See #21642. Fix applied 2014-06-07.
Hence Berker's guesses.
def test_float_exponent_tokenization(self):
# See issue 21642.
self.assertEqual(1 if 1else 0, 1)
self.assertEqual(1 if 0else 0, 0)
Berker Peksag added the comment:
Thanks for the report! How did you run the test? I think there is something
wrong with your installation (or you probably ran the test with the system
Python.)
$ ./python -m test.regrtest test_grammar
[1/1] test_grammar
1 test OK.
[48645 refs]
New submission from Jan Welker:
I compiled Python 2.7.12 from source and ran the tests unsuccessful.
Compiling /usr/lib/python2.7/test/test_grammar.py ...
File "/usr/lib/python2.7/test/test_grammar.py", line 80
self.assertEqual(1 if 1else 0, 1)
^
SyntaxError: inv