cpython: 4ad33d82193d (original) (raw)

Mercurial > cpython

changeset 91061:4ad33d82193d 3.4

allow the keyword else immediately after (no space) an integer (closes #21642) [#21642]

Benjamin Peterson benjamin@python.org
date Sat, 07 Jun 2014 12:36:39 -0700
parents d23cea976f46
children d5998cca01a8 0c712828fb6e
files Lib/test/test_grammar.py Misc/NEWS Parser/tokenizer.c
diffstat 3 files changed, 24 insertions(+), 5 deletions(-)[+] [-] Lib/test/test_grammar.py 6 Misc/NEWS 4 Parser/tokenizer.c 19

line wrap: on

line diff

--- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -80,6 +80,12 @@ class TokenTests(unittest.TestCase): x = .3e14 x = 3.1e4

+ def test_string_literals(self): x = ''; y = ""; self.assertTrue(len(x) == 0 and x == y) x = '''; y = "'"; self.assertTrue(len(x) == 1 and x == y and ord(x) == 39)

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,10 @@ Release date: XXXX-XX-XX Core and Builtins ----------------- +- Issue #21642: If the conditional if-else expression, allow an integer written

--- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -1597,15 +1597,24 @@ tok_get(struct tok_state *tok, char **p_ } while (isdigit(c)); } if (c == 'e' || c == 'E') {