Skip to content

string_processing: Better whitespace allocation for an assert statement #3663

@st-pasha

Description

@st-pasha

Describe the style change

Strange indentation of a long assert statement, in --preview (it works correctly in the stable branch).

Examples in the current (preview) Black style

assert (
    result
    == "Lorem ipsum dolor sit amet,\n"
    "consectetur adipiscing elit,\n"
    "sed doeiusmod tempor incididunt\n"
)

Desired style

assert result == (
    "Lorem ipsum dolor sit amet,\n"
    "consectetur adipiscing elit,\n"
    "sed doeiusmod tempor incididunt\n"
)

Additional context

Similar to #3409

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: preview styleIssues with the preview and unstable style. Add the name of the responsible feature in the title.F: stringsRelated to our handling of stringsT: 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