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

inconsistent format of if condition #3381

Closed
drdv opened this issue Nov 13, 2022 · 2 comments
Closed

inconsistent format of if condition #3381

drdv opened this issue Nov 13, 2022 · 2 comments
Labels
F: linebreak How should we split up lines? R: duplicate This issue or pull request already exists T: style What do we want Blackened code to look like?

Comments

@drdv
Copy link

drdv commented Nov 13, 2022

black, 22.10.0 (compiled: yes)
Python (CPython) 3.10.2

After applying Black:

def f2(some_name1, some_name2):
    if (some_name1.is_constant or some_name1.is_affine) and (
        some_name2.is_constant or some_name2.is_affine
    ):
        pass


def f3(some_name1, some_name2):
    if (
        (some_name1.is_constant or some_name1.is_affine)
        and (some_name2.is_constant or some_name2.is_affine)
        and (some_name3.is_constant or some_name3.is_affine)
    ):
        pass

The formatting in f2() seems to be inconsistent. Based on f3(), I expected to have:

def f2(some_name1, some_name2):
    if (
        (some_name1.is_constant or some_name1.is_affine)
        and (some_name2.is_constant or some_name2.is_affine)
    ):
        pass
@drdv drdv added the T: style What do we want Blackened code to look like? label Nov 13, 2022
@JelleZijlstra JelleZijlstra added the F: linebreak How should we split up lines? label Nov 13, 2022
@yilei
Copy link
Contributor

yilei commented Nov 14, 2022

I think this is another example for #2156

@drdv
Copy link
Author

drdv commented Nov 14, 2022

Indeed. Thanks.

@drdv drdv closed this as completed Nov 14, 2022
@ichard26 ichard26 added the R: duplicate This issue or pull request already exists label Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: linebreak How should we split up lines? R: duplicate This issue or pull request already exists T: style What do we want Blackened code to look like?
Projects
None yet
Development

No branches or pull requests

4 participants