Skip to content

Strange placement of == operator #920

@joernheissler

Description

@joernheissler

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    F: linebreakHow should we split up lines?T: styleWhat do we want Blackened code to look like?

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions