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

parenthesize complicated for loop iterable #2309

Open
Akuli opened this issue Jun 5, 2021 · 0 comments
Open

parenthesize complicated for loop iterable #2309

Akuli opened this issue Jun 5, 2021 · 0 comments
Labels
F: parentheses Too many parentheses, not enough parentheses, and so on. T: enhancement New feature or request

Comments

@Akuli
Copy link

Akuli commented Jun 5, 2021

Describe the style change

needs more parens

Examples in the current Black style

for filetype in get_parsed_args().new_file or []:
    print(filetype)

Desired style

for filetype in (get_parsed_args().new_file or []):
    print(filetype)

Additional context

argparse can annoyingly give None, purpose of or [] is to do nothing in that case

@Akuli Akuli mentioned this issue Jun 5, 2021
2 tasks
@JelleZijlstra JelleZijlstra added F: parentheses Too many parentheses, not enough parentheses, and so on. T: enhancement New feature or request labels Jun 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: parentheses Too many parentheses, not enough parentheses, and so on. T: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants