Skip to content

"More concise formatting for dummy implementations" can be less concise #3872

@bersbersbers

Description

@bersbersbers

Describe the bug

TLDR: #3796 ("More concise formatting for dummy implementations") can make stuff longer.

To Reproduce

def long_function_with_sine_params_and_long_return(param, another_one) -> ReturnType:
    ...

which is fine in the current style, is now formatted, in the preview style, as

def long_function_with_sine_params_and_long_return(
    param, another_one
) -> ReturnType: ...

which is longer than before.

Expected behavior

I am not sure:

  • Accept this new behavior?
  • Allow ... on a line of its own if appending it to the previous line leads to line breaks?
  • Disregard trailing ... in line-break computations?

Environment

  • Black's version: 23.9.0
  • OS and Python version: 3.11.5

Additional context

https://black.vercel.app/?version=stable&state=_Td6WFoAAATm1rRGAgAhARYAAAB0L-Wj4ADCAIxdAD2IimZxl1N_WlbvK5V-UA6POmCWAlBigHXJM-vgsJNFnnfVB1-uHJ4V0GUgpC_6VVP7iU_GTn8jdXsR0PplFpGKggfg_JrV_yEDHau7wqaLqM0PEYr5luk1ntOa9ao5e6APRTqQtZ8UMKr7aFf3fB-gB6FhVm9E3IiYA1BFBYgrpdvrEGlSdzRfQjDgAIrLDdzoDymqAAGoAcMBAAAxRUBuscRn-wIAAAAABFla

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.T: bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions