Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-36541: lib2to3: Support named assignment expressions #12702

Merged
merged 1 commit into from Apr 2, 2020

Conversation

thatch
Copy link
Contributor

@thatch thatch commented Apr 6, 2019

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.

https://bugs.python.org/issue36541

@the-knights-who-say-ni
Copy link

@the-knights-who-say-ni the-knights-who-say-ni commented Apr 6, 2019

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for your contribution, we look forward to reviewing it!

@lisroach
Copy link
Contributor

@lisroach lisroach commented May 8, 2019

@thatch please add a NEWS entry (you can use the blurb add tool).

@thatch thatch force-pushed the lib2to3-assignment-expressions branch from e8fe78d to 9e763e7 Compare Jun 19, 2019
@gpshead
Copy link
Member

@gpshead gpshead commented Oct 24, 2019

I've clicked the buttons to land the parsing fix for https://bugs.python.org/issue33348 first (#6586). you'll likely need to merge and update this PR after that merges. Otherwise this looks good to go in.

@csabella
Copy link
Contributor

@csabella csabella commented Jan 25, 2020

@thatch, please take a look at the last review about rebasing this change. Thanks!

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.
@thatch thatch force-pushed the lib2to3-assignment-expressions branch from da3dfe0 to 949dcef Compare Feb 24, 2020
@csabella csabella requested a review from gpshead Feb 25, 2020
@isidentical
Copy link
Sponsor Member

@isidentical isidentical commented Apr 2, 2020

Any update regarding this patch?

@thatch
Copy link
Contributor Author

@thatch thatch commented Apr 2, 2020

I force-pushed a rebase on Feb 24, I think this is waiting on @gpshead review

gpshead
gpshead approved these changes Apr 2, 2020
@gpshead gpshead added the type-bug label Apr 2, 2020
@gpshead gpshead merged commit 3c3aa45 into python:master Apr 2, 2020
9 checks passed
@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Apr 2, 2020

Thanks @thatch for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this issue Apr 2, 2020
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 3c3aa45)

Co-authored-by: Tim Hatch <tim@timhatch.com>
@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Apr 2, 2020

GH-19315 is a backport of this pull request to the 3.8 branch.

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Apr 2, 2020

Sorry, @thatch and @gpshead, I could not cleanly backport this to 3.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 3c3aa4516c70753de06bb142b6793d01330fcf0f 3.7

@miss-islington miss-islington assigned gpshead and unassigned pablogsal Apr 2, 2020
miss-islington added a commit that referenced this issue Apr 2, 2020
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 3c3aa45)

Co-authored-by: Tim Hatch <tim@timhatch.com>
@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Apr 2, 2020

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot PPC64 Fedora 3.x has failed when building commit 3c3aa45.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/8/builds/659) and take a look at the build logs.
  4. Check if the failure is related to this commit (3c3aa45) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/8/builds/659

Failed tests:

  • test_asyncio

Summary of the results of the build (if available):

==

Click to see traceback logs
remote: Enumerating objects: 30, done.�[K
remote: Counting objects:   3% (1/30)�[K
remote: Counting objects:   6% (2/30)�[K
remote: Counting objects:  10% (3/30)�[K
remote: Counting objects:  13% (4/30)�[K
remote: Counting objects:  16% (5/30)�[K
remote: Counting objects:  20% (6/30)�[K
remote: Counting objects:  23% (7/30)�[K
remote: Counting objects:  26% (8/30)�[K
remote: Counting objects:  30% (9/30)�[K
remote: Counting objects:  33% (10/30)�[K
remote: Counting objects:  36% (11/30)�[K
remote: Counting objects:  40% (12/30)�[K
remote: Counting objects:  43% (13/30)�[K
remote: Counting objects:  46% (14/30)�[K
remote: Counting objects:  50% (15/30)�[K
remote: Counting objects:  53% (16/30)�[K
remote: Counting objects:  56% (17/30)�[K
remote: Counting objects:  60% (18/30)�[K
remote: Counting objects:  63% (19/30)�[K
remote: Counting objects:  66% (20/30)�[K
remote: Counting objects:  70% (21/30)�[K
remote: Counting objects:  73% (22/30)�[K
remote: Counting objects:  76% (23/30)�[K
remote: Counting objects:  80% (24/30)�[K
remote: Counting objects:  83% (25/30)�[K
remote: Counting objects:  86% (26/30)�[K
remote: Counting objects:  90% (27/30)�[K
remote: Counting objects:  93% (28/30)�[K
remote: Counting objects:  96% (29/30)�[K
remote: Counting objects: 100% (30/30)�[K
remote: Counting objects: 100% (30/30), done.�[K
remote: Compressing objects:   9% (1/11)�[K
remote: Compressing objects:  18% (2/11)�[K
remote: Compressing objects:  27% (3/11)�[K
remote: Compressing objects:  36% (4/11)�[K
remote: Compressing objects:  45% (5/11)�[K
remote: Compressing objects:  54% (6/11)�[K
remote: Compressing objects:  63% (7/11)�[K
remote: Compressing objects:  72% (8/11)�[K
remote: Compressing objects:  81% (9/11)�[K
remote: Compressing objects:  90% (10/11)�[K
remote: Compressing objects: 100% (11/11)�[K
remote: Compressing objects: 100% (11/11), done.�[K
remote: Total 16 (delta 14), reused 6 (delta 5), pack-reused 0�[K
From https://github.com/python/cpython
 * branch            master     -> FETCH_HEAD
Reset branch 'master'

test_ttk_guionly skipped -- Tk unavailable due to TclError: no display name and no $DISPLAY environment variab [...]
test_kqueue skipped -- test works only on BSD
/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '
/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/multiprocessing/resource_tracker.py:229: UserWarning: resource_tracker: '/psm_113222e3': [Errno 2] No such file or directory: '/psm_113222e3'
  warnings.warn('resource_tracker: %r: %s' % (name, e))
test_winreg skipped -- No module named 'winreg'
test_msilib skipped -- No module named '_msi'
test_ossaudiodev skipped -- [Errno 2] No such file or directory: '/dev/dsp'
test_tk skipped -- Tk unavailable due to TclError: no display name and no $DISPLAY environment variab [...]
test_winconsoleio skipped -- test only relevant on win32
test_ioctl skipped -- Unable to open /dev/tty
stty: standard input: Inappropriate ioctl for device
test_startfile skipped -- object <module 'os' from '/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/os.py'> has no attribute 'startfile'
Timeout (0:15:00)!
Thread 0x00003fffb6265810 (most recent call first):
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/selectors.py", line 468 in select
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/asyncio/base_events.py", line 1854 in _run_once
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/asyncio/base_events.py", line 596 in run_forever
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/asyncio/base_events.py", line 629 in run_until_complete
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/test_asyncio/test_subprocess.py", line 176 in test_kill
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/case.py", line 616 in _callTestMethod
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/case.py", line 659 in run
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/case.py", line 719 in __call__
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/suite.py", line 122 in run
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/suite.py", line 84 in __call__
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/suite.py", line 122 in run
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/suite.py", line 84 in __call__
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/suite.py", line 122 in run
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/suite.py", line 84 in __call__
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/suite.py", line 122 in run
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/suite.py", line 84 in __call__
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/suite.py", line 122 in run
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/suite.py", line 84 in __call__
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/runner.py", line 176 in run
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/support/__init__.py", line 2079 in _run_suite
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/support/__init__.py", line 2201 in run_unittest
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/libregrtest/runtest.py", line 209 in _test_module
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/libregrtest/runtest.py", line 234 in _runtest_inner2
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/libregrtest/runtest.py", line 270 in _runtest_inner
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/libregrtest/runtest.py", line 140 in _runtest
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/libregrtest/runtest.py", line 193 in runtest
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/libregrtest/runtest_mp.py", line 80 in run_tests_worker
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/libregrtest/main.py", line 654 in _main
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/libregrtest/main.py", line 634 in main
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/libregrtest/main.py", line 712 in main
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/regrtest.py", line 43 in _main
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/regrtest.py", line 47 in <module>
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/runpy.py", line 87 in _run_code
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/runpy.py", line 197 in _run_module_as_main
test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run
test_devpoll skipped -- test works only on Solaris OS family
test_tix skipped -- Tk unavailable due to TclError: no display name and no $DISPLAY environment variab [...]
test_flock (__main__.FNTLEINTRTest) ... ok
test_lockf (__main__.FNTLEINTRTest) ... ok
test_read (__main__.OSEINTRTest) ... ok
test_wait (__main__.OSEINTRTest) ... ok
test_wait3 (__main__.OSEINTRTest) ... ok
test_wait4 (__main__.OSEINTRTest) ... ok
test_waitpid (__main__.OSEINTRTest) ... ok
test_write (__main__.OSEINTRTest) ... ok
test_devpoll (__main__.SelectEINTRTest) ... skipped 'need select.devpoll'
test_epoll (__main__.SelectEINTRTest) ... ok
test_kqueue (__main__.SelectEINTRTest) ... skipped 'need select.kqueue'
test_poll (__main__.SelectEINTRTest) ... ok
test_select (__main__.SelectEINTRTest) ... ok
test_sigtimedwait (__main__.SignalEINTRTest) ... ok
test_sigwaitinfo (__main__.SignalEINTRTest) ... ok
test_accept (__main__.SocketEINTRTest) ... ok
test_open (__main__.SocketEINTRTest) ... ok
test_os_open (__main__.SocketEINTRTest) ... ok
test_recv (__main__.SocketEINTRTest) ... ok
test_recvmsg (__main__.SocketEINTRTest) ... ok
test_send (__main__.SocketEINTRTest) ... ok
test_sendall (__main__.SocketEINTRTest) ... ok
test_sendmsg (__main__.SocketEINTRTest) ... ok
test_sleep (__main__.TimeEINTRTest) ... ok

----------------------------------------------------------------------
Ran 24 tests in 6.802s

OK (skipped=2)
test_winsound skipped -- No module named 'winsound'
Timeout (0:15:00)!
Thread 0x00003fff7da15810 (most recent call first):
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/selectors.py", line 468 in select
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/asyncio/base_events.py", line 1854 in _run_once
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/asyncio/base_events.py", line 596 in run_forever
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/asyncio/base_events.py", line 629 in run_until_complete
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/test_asyncio/test_subprocess.py", line 189 in test_terminate
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/case.py", line 616 in _callTestMethod
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/case.py", line 659 in run
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/case.py", line 719 in __call__
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/suite.py", line 122 in run
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/suite.py", line 84 in __call__
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/suite.py", line 122 in run
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/suite.py", line 84 in __call__
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/suite.py", line 122 in run
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/suite.py", line 84 in __call__
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/suite.py", line 122 in run
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/suite.py", line 84 in __call__
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/suite.py", line 122 in run
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/suite.py", line 84 in __call__
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/unittest/runner.py", line 176 in run
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/support/__init__.py", line 2079 in _run_suite
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/support/__init__.py", line 2201 in run_unittest
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/libregrtest/runtest.py", line 209 in _test_module
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/libregrtest/runtest.py", line 234 in _runtest_inner2
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/libregrtest/runtest.py", line 270 in _runtest_inner
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/libregrtest/runtest.py", line 153 in _runtest
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/libregrtest/runtest.py", line 193 in runtest
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/libregrtest/main.py", line 318 in rerun_failed_tests
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/libregrtest/main.py", line 691 in _main
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/libregrtest/main.py", line 634 in main
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/libregrtest/main.py", line 712 in main
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/test/__main__.py", line 2 in <module>
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/runpy.py", line 87 in _run_code
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64/build/Lib/runpy.py", line 197 in _run_module_as_main
make: *** [buildbottest] Error 1

thatch added a commit to thatch/cpython that referenced this issue Apr 2, 2020
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 3c3aa45)
thatch added a commit to thatch/cpython that referenced this issue Apr 2, 2020
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 3c3aa45)

Co-authored-by: Tim Hatch <tim@timhatch.com>
@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Apr 2, 2020

GH-19317 is a backport of this pull request to the 3.7 branch.

@thatch
Copy link
Contributor Author

@thatch thatch commented Apr 2, 2020

cherry_pick for 3.7 is #19317 (I had to manually push as the tool didn't understand my style of origin being read-only and having a separate remote for pushing)

thatch added a commit to thatch/cpython that referenced this issue Apr 3, 2020
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 3c3aa45)
thatch added a commit to thatch/cpython that referenced this issue Apr 3, 2020
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 3c3aa45)

Co-authored-by: Tim Hatch <tim@timhatch.com>
gpshead pushed a commit that referenced this issue Apr 3, 2020
) (GH-19317)

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 3c3aa45)

Co-authored-by: Tim Hatch <tim@timhatch.com>
vegerot pushed a commit to vegerot/cpython that referenced this issue Jun 10, 2020
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.
vegerot pushed a commit to vegerot/cpython that referenced this issue Jun 10, 2020
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.
gmelikov pushed a commit to gmelikov/cpython that referenced this issue Aug 22, 2020
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.
chrisburr pushed a commit to chrisburr/cpython that referenced this issue Dec 9, 2020
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA signed type-bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants