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

Strange placement of == operator #920

Open
joernheissler opened this issue Jul 9, 2019 · 0 comments
Open

Strange placement of == operator #920

joernheissler opened this issue Jul 9, 2019 · 0 comments
Labels
F: linebreak How should we split up lines? T: style What do we want Blackened code to look like?

Comments

@joernheissler
Copy link

Operating system: Debian GNU/Linux sid
Python version: 3.8~b2
Black version: f3bb22a
Does also happen on master: yup

Hello,

input code:

def test() -> None:
    assert mgf_sha2_256_meta == pss.parse_pss_options(
        pub, def_hash, rsa.PssOptions(mgf_alg=rsa.MgfAlgorithm(rsa.MgfAlgorithmId.MGF1))).mgf_alg

output code:

def test() -> None:
    assert (
        mgf_sha2_256_meta
        == pss.parse_pss_options(
            pub,
            def_hash,
            rsa.PssOptions(mgf_alg=rsa.MgfAlgorithm(rsa.MgfAlgorithmId.MGF1)),
        ).mgf_alg
    )

The placement of the == operator looks very strange to me.

I'd prefer one of those:

def test() -> None:
    assert (
        mgf_sha2_256_meta == pss.parse_pss_options(
            pub,
            def_hash,
            rsa.PssOptions(mgf_alg=rsa.MgfAlgorithm(rsa.MgfAlgorithmId.MGF1)),
        ).mgf_alg
    )

or

def test() -> None:
    assert mgf_sha2_256_meta == pss.parse_pss_options(
        pub,
        def_hash,
        rsa.PssOptions(mgf_alg=rsa.MgfAlgorithm(rsa.MgfAlgorithmId.MGF1)),
    ).mgf_alg

If the actual result is by intention, is there any document that describes the rationale behind this decision?

Thanks!

@JelleZijlstra JelleZijlstra added T: style What do we want Blackened code to look like? F: linebreak How should we split up lines? labels May 30, 2021
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? T: style What do we want Blackened code to look like?
Projects
None yet
Development

No branches or pull requests

2 participants