Line wrapping on generic functions using the type parameter syntax #3929
Labels
S: accepted
The changes in this design / enhancement issue have been accepted and can be implemented
T: style
What do we want Blackened code to look like?
Describe the style change
The suggested style change regards the type parameter syntax introduced in Python 3.12.
When formatting lines too long, I think line-wrapping should occur in the arguments' parenthesis rather than in the type parameters' brackets.
Examples in the current Black style
This would work with any generic function using the new type parameter syntax with a long enough signature (longer than the
line-length
).Desired style
I think this kind of line-wrapping, keeping the type parameters list on a single line when possible, should be preferred over what currently happens as it is more readable.
The text was updated successfully, but these errors were encountered: