Staging
v0.5.1
https://github.com/python/cpython
Revision 96c5f5a3a3fabf43e8114d0dbc30bed409da1ba6 authored by Tim Hatch on 03 April 2020, 19:14:15 UTC, committed by GitHub on 03 April 2020, 19:14:15 UTC
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 3c3aa4516c70753de06bb142b6793d01330fcf0f)

Co-authored-by: Tim Hatch <tim@timhatch.com>
1 parent d19162f
History
Tip revision: 96c5f5a3a3fabf43e8114d0dbc30bed409da1ba6 authored by Tim Hatch on 03 April 2020, 19:14:15 UTC
[3.7] bpo-36541: lib2to3: Support named assignment expressions (GH-12702) (GH-19317)
Tip revision: 96c5f5a
File Mode Size
.azure-pipelines
.github
Doc
Grammar
Include
Lib
Mac
Misc
Modules
Objects
PC
PCbuild
Parser
Programs
Python
Tools
m4
.gitattributes -rw-r--r-- 1.6 KB
.gitignore -rw-r--r-- 1.5 KB
.travis.yml -rw-r--r-- 6.1 KB
CODE_OF_CONDUCT.rst -rw-r--r-- 631 bytes
LICENSE -rw-r--r-- 12.5 KB
Makefile.pre.in -rw-r--r-- 62.9 KB
README.rst -rw-r--r-- 9.6 KB
aclocal.m4 -rw-r--r-- 10.7 KB
config.guess -rwxr-xr-x 43.1 KB
config.sub -rwxr-xr-x 35.4 KB
configure -rwxr-xr-x 492.1 KB
configure.ac -rw-r--r-- 164.8 KB
install-sh -rwxr-xr-x 7.0 KB
pyconfig.h.in -rw-r--r-- 42.3 KB
setup.py -rw-r--r-- 101.3 KB

README.rst

back to top