Skip to content

No line-wrapping for keyword argument #933

Closed

Description

Operating system: Win10 Version 10.0.18362 Build 18362
Python version: 3.7.3
Black version: 9.3b0
Does also happen on master: Yes

Input:

def g() -> None:
    name_of_local_variable = "Very long string value that should be placed on the next line"
    f(
        name_of_the_parameter="Very long string value that should be placed on the next line"
    )

Output:

def g() -> None:
    name_of_local_variable = (
        "Very long string value that should be placed on the next line"
    )
    f(
        name_of_the_parameter="Very long string value that should be placed on the next line"
    )

name_of_local_variable's value is put on the next line, but name_of_the_parameter is untouched.
This is true even if I use name_of_the_parameter=lambda x: "Very long string value that should be placed on the next line" which gives two opportunities for wrapping.

Activity

  1. zsol commented on Jul 30, 2019

    @zsol
    Collaborator

    This is likely the same problem as #620. Will keep this open just in case we decide to do different formatting for kwargs/dict literals

  2. added
    T: bugSomething isn't working
    F: parenthesesToo many parentheses, not enough parentheses, and so on.
    and removed
    T: bugSomething isn't working
    on Jul 30, 2019
  3. added a commit that references this issue on May 8, 2020
    544ea9c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    F: parenthesesToo many parentheses, not enough parentheses, and so on.T: enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions