classification
Title: lib2to3 doesn't provide a grammar where exec is a function
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, eli.bendersky, gvanrossum
Priority: normal Keywords: patch

Created on 2015-04-09 13:49 by eli.bendersky, last changed 2019-05-20 20:27 by gvanrossum. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 13272 merged BTaskaya, 2019-05-13 02:51
Messages (3)
msg240326 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2015-04-09 13:49
lib2to3 helpfully provides pygram.python_grammar_no_print_statement for parsing Python 3 ('print' has the semantics of an identifier, not a keyword)

However, the same courtesy is not extended to 'exec', which also turns from a statement to an identifier in Python 3.

I'd propose adding something like python_grammar_no_print_and_exec_statement 

The name's a handful, but it's explicit and I can't think of anything else, given that we don't want to change the lib2to3 API at this time to rename these grammars using some other convention.
msg342949 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2019-05-20 20:27
New changeset 4011d865d0572a3dd9988f2935cd835cc8fb792a by Guido van Rossum (Batuhan Taşkaya) in branch 'master':
bpo-23896: Add a grammar where exec isn't a stmt (#13272)
https://github.com/python/cpython/commit/4011d865d0572a3dd9988f2935cd835cc8fb792a
msg342951 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2019-05-20 20:27
Thanks Batuhan Taşkaya!
History
Date User Action Args
2019-05-20 20:27:49gvanrossumsetstatus: open -> closed
resolution: fixed
messages: + msg342951

stage: patch review -> resolved
2019-05-20 20:27:14gvanrossumsetnosy: + gvanrossum
messages: + msg342949
2019-05-13 02:51:47BTaskayasetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request13178
2015-04-11 23:10:23ned.deilysetnosy: + benjamin.peterson
2015-04-09 13:49:42eli.benderskycreate