diff options
author | Xtreak <tir.karthi@gmail.com> | 2019-02-01 21:40:16 (GMT) |
---|---|---|
committer | Emily Morehouse <emilyemorehouse@gmail.com> | 2019-02-01 21:40:16 (GMT) |
commit | d4fceaafb8e3f8700d9ec6ab37a51e903392f74f (patch) | |
tree | fb3681a954e8d42a3a3161ad38eebcb4eeaf9884 /Lib/test/test_parser.py | |
parent | 85d83ec7c99727476c79feb5c34c65264a99144e (diff) | |
download | cpython-d4fceaafb8e3f8700d9ec6ab37a51e903392f74f.zip cpython-d4fceaafb8e3f8700d9ec6ab37a51e903392f74f.tar.gz cpython-d4fceaafb8e3f8700d9ec6ab37a51e903392f74f.tar.bz2 |
bpo-35877: Make parenthesis optional for named expression in while statement (GH-11724)
* Add parenthesis optional in named expressions for while statement
* Add NEWS entry
Diffstat (limited to 'Lib/test/test_parser.py')
-rw-r--r-- | Lib/test/test_parser.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py index 19f1782..0afeb32 100644 --- a/Lib/test/test_parser.py +++ b/Lib/test/test_parser.py @@ -426,6 +426,7 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase): self.check_suite("(a := 1)") self.check_suite("(a := a)") self.check_suite("if (match := pattern.search(data)) is None: pass") + self.check_suite("while match := pattern.search(f.read()): pass") self.check_suite("[y := f(x), y**2, y**3]") self.check_suite("filtered_data = [y for x in data if (y := f(x)) is None]") self.check_suite("(y := f(x))") |