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

Fix extracting generator without parens #505

Merged
merged 3 commits into from Oct 3, 2022

Conversation

lieryan
Copy link
Member

@lieryan lieryan commented Sep 27, 2022

Description

Extracting generator comprehension without selecting the surrounding parentheses may produce invalid code. This commit adds surrounding parentheses when it detects that the selected code is a bare generator comprehension.

Fixes #411

Checklist (delete if not relevant):

  • I have added tests that prove my fix is effective or that my feature works
  • I have updated CHANGELOG.md

Extracting generator comprehension without selecting the surrounding
parentheses may produce invalid code. This commit adds surrounding
parentheses when it detects that the selected code is a bare generator
comprehension.
@lieryan lieryan changed the title Fix #411. Fix extracting generator without parens Fix extracting generator without parens Sep 27, 2022
@lieryan lieryan merged commit 2733daa into master Oct 3, 2022
@lieryan lieryan deleted the lieryan-411-parensless-generator-comprehension branch October 3, 2022 03:32
@lieryan lieryan added this to the 1.4.0 milestone Oct 5, 2022
@lieryan lieryan self-assigned this Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extracting generator comprehension may produce invalid code
1 participant