| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
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! |
Sorry, something went wrong.
|
@thatch please add a NEWS entry (you can use the blurb add tool). |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
|
@thatch, please take a look at the last review about rebasing this change. Thanks! |
Sorry, something went wrong.
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.
|
Any update regarding this patch? |
Sorry, something went wrong.
|
I force-pushed a rebase on Feb 24, I think this is waiting on @gpshead review |
Sorry, something went wrong.
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>
|
GH-19315 is a backport of this pull request to the 3.8 branch. |
Sorry, something went wrong.
|
Sorry, @thatch and @gpshead, I could not cleanly backport this to 3.7 due to a conflict. |
Sorry, something went wrong.
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>
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot PPC64 Fedora 3.x has failed when building commit 3c3aa45. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/8/builds/659 Failed tests:
Summary of the results of the build (if available): == Click to see traceback logsremote: 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 |
Sorry, something went wrong.
|
GH-19317 is a backport of this pull request to the 3.7 branch. |
Sorry, something went wrong.
|
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) |
Sorry, something went wrong.
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)
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>
) (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>
| Back | FazBrowse Home | New Git URL |
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