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

lib2to3 provide a way to use exec as a function in RefactoringTool #83494

Closed
isidentical opened this issue Jan 12, 2020 · 3 comments
Closed

lib2to3 provide a way to use exec as a function in RefactoringTool #83494

isidentical opened this issue Jan 12, 2020 · 3 comments
Labels
3.9 only security fixes topic-2to3

Comments

@isidentical
Copy link
Sponsor Member

BPO 39313
Nosy @benjaminp, @pablogsal, @miss-islington, @isidentical
PRs
  • bpo-39313: Add an option to RefactoringTool for using exec as a function #17967
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-01-12.22:24:33.403>
    created_at = <Date 2020-01-12.15:15:27.401>
    labels = ['expert-2to3', '3.9']
    title = 'lib2to3 provide a way to use exec as a function in RefactoringTool'
    updated_at = <Date 2020-01-12.22:24:33.402>
    user = 'https://github.com/isidentical'

    bugs.python.org fields:

    activity = <Date 2020-01-12.22:24:33.402>
    actor = 'pablogsal'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-01-12.22:24:33.403>
    closer = 'pablogsal'
    components = ['2to3 (2.x to 3.x conversion tool)']
    creation = <Date 2020-01-12.15:15:27.401>
    creator = 'BTaskaya'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 39313
    keywords = ['patch']
    message_count = 3.0
    messages = ['359853', '359873', '359879']
    nosy_count = 4.0
    nosy_names = ['benjamin.peterson', 'pablogsal', 'miss-islington', 'BTaskaya']
    pr_nums = ['17967']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue39313'
    versions = ['Python 3.9']

    @isidentical
    Copy link
    Sponsor Member Author

    bpo-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.

    @isidentical isidentical added 3.9 only security fixes topic-2to3 labels Jan 12, 2020
    @isidentical
    Copy link
    Sponsor Member Author

    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.

    @isidentical isidentical changed the title lib2to3 RefactoringTool python_grammar_no_print_and_exec_statement lib2to3 provide a way to use exec as a function in RefactoringTool Jan 12, 2020
    @miss-islington
    Copy link
    Contributor

    New changeset 61b1415 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)
    61b1415

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes topic-2to3
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants