cpython/Lib/lib2to3
Miss Islington (bot) 1098671e4e
lib2to3: Support named assignment expressions (GH-12702)
There are two copies of the grammar -- the one used by Python itself as
Grammar/Grammar, and the one used by lib2to3 which has necessarily diverged at
Lib/lib2to3/Grammar.txt because it needs to support older syntax an we want it
to be reasonable stable to avoid requiring fixer rewrites.

This brings suport for syntax like `if x:= foo():` to match what the live
Python grammar does.

This should've been added at the time of the walrus operator itself, but lib2to3 being
independent is often overlooked.  So we do consider this a bugfix rather than enhancement.
(cherry picked from commit 3c3aa4516c)

Co-authored-by: Tim Hatch <tim@timhatch.com>
2020-04-02 16:03:09 -07:00
..
fixes bpo-38871: Fix lib2to3 for filter-based statements that contain lambda (GH-17780) 2020-01-07 09:52:06 -08:00
pgen2 lib2to3: Support named assignment expressions (GH-12702) 2020-04-02 16:03:09 -07:00
tests lib2to3: Support named assignment expressions (GH-12702) 2020-04-02 16:03:09 -07:00
Grammar.txt lib2to3: Support named assignment expressions (GH-12702) 2020-04-02 16:03:09 -07:00
PatternGrammar.txt
__init__.py
__main__.py
btm_matcher.py bpo-29957: change LBYL key lookup to dict.setdefault (#938) 2017-04-01 23:02:31 -07:00
btm_utils.py
fixer_base.py
fixer_util.py Revert "closes bpo-27494: Fix 2to3 handling of trailing comma after a generator expression (GH-3771)" (#8241) 2018-07-31 09:34:30 +03:00
main.py bpo-31583: Fix 2to3 for using with --add-suffix option (GH-3758) 2018-04-18 16:50:25 -07:00
patcomp.py remove unused import (#5040) 2017-12-28 23:24:40 -08:00
pygram.py bpo-23896: Add a grammar where exec isn't a stmt (#13272) 2019-05-20 13:27:10 -07:00
pytree.py
refactor.py closes bpo-37675: Use pkgutil.iter_modules to find fixers in a package rather than listdir. (14942) 2019-07-24 17:00:39 -07:00