classification
Title: lib2to3 provide a way to use exec as a function in RefactoringTool
Type: Stage: resolved
Components: 2to3 (2.x to 3.x conversion tool) Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: BTaskaya, benjamin.peterson, miss-islington, pablogsal
Priority: normal Keywords: patch

Created on 2020-01-12 15:15 by BTaskaya, last changed 2020-01-12 22:24 by pablogsal. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 17967 merged BTaskaya, 2020-01-12 15:18
Messages (3)
msg359853 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2020-01-12 15:15
issue 23896 introduced a grammar without print and exec statements (they both are functions now) but both the lib2to3 cli script and RefactoringTool lacks of that functionality (which is pretty useful for outside users of lib2to3 like formatters)

(RefactoringTool)
        if self.options["print_function"]:
            self.grammar = pygram.python_grammar_no_print_statement
        else:
            self.grammar = pygram.python_grammar


It should be supported here and on the command line script.
msg359873 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2020-01-12 20:41
After discussing with @pablogsal, instead of offering 2 options that one overlaps another we added -e option to 2to3.main and exec_function option (alongside print_funtion) to RefactoringTool.
msg359879 - (view) Author: miss-islington (miss-islington) Date: 2020-01-12 22:13
New changeset 61b14151cc92021a10f94765eaa152ed04eb262a by Miss Islington (bot) (Batuhan Ta┼čkaya) in branch 'master':
bpo-39313: Add an option to RefactoringTool for using exec as a function (GH-17967)
https://github.com/python/cpython/commit/61b14151cc92021a10f94765eaa152ed04eb262a
History
Date User Action Args
2020-01-12 22:24:33pablogsalsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-01-12 22:13:35miss-islingtonsetnosy: + miss-islington
messages: + msg359879
2020-01-12 20:41:37BTaskayasetnosy: + pablogsal

messages: + msg359873
title: lib2to3 RefactoringTool python_grammar_no_print_and_exec_statement -> lib2to3 provide a way to use exec as a function in RefactoringTool
2020-01-12 15:18:27BTaskayasetkeywords: + patch
stage: patch review
pull_requests: + pull_request17375
2020-01-12 15:15:27BTaskayacreate