Open MichaReiser opened 11 months ago
I don't know how black views this, but we've always viewed tuples are being more akin to objects than collections.
In examples like above I'd want to keep the tuple on one line and the list multi line.
so absent other context ([(
, I'd favor grouping as ([
and (
but [((
I'd favor grouping as [
and ((
This is feedback related to the
hug_parens_with_braces_and_square_brackets
preview style.Describe the style change
Only collapse the first set of parens rather than all parens recursively. Having too many opening/closing parens on a single line makes it harder to distinguish the individual parentheses (especially if they are all of the same kind).
Examples in the current Black style
Here an example from Ruff's shade after implementing the
hug_parens_with_braces_and_square_brackets
preview style recursively.Desired style
Additional context
This issue is split out from my stable style 2024 comment.
Ruff implements
hug_parens_with_braces_and_square_brackets
in preview style but we intentionally haven't implemented recursive hugging yet.