You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi guys, first of all thanks for this amazing tool! Glad to see it taking the Python world by storm.
This is a fairly minor style change request.
The formatting I take issue with occurs during item assignment. When the assignment exceeds the line length and the RHS has no "required" parentheses to break on, it chooses to break on the square brackets on the LHS of the assignment:
# CURRENT BEHAVIOUR# in:some_dictionary["some_key"] =some_long_expression_causing_long_line# out:some_dictionary[
"some_key"
] =some_long_expression_causing_long_line
Personally I think this is really ugly - looking at this expression, it is not immediately obvious that an assignment is happening, since the = is moved to the 3rd line. Of all the non-blacked code I've ever read, not one line has ever been formatted like that, which tells me it's not totally human-friendly.
My desired result for the above input would be like the following:
Obviously for the cases where my desired behaviour would still result in the 1st line being longer than the desired line length, the current behaviour should be applied.
My current workaround for this styling caveat is to use dict.update() instead (though obviously this isn't a general solution since __setitem__ is not exclusive to MutableMappings):
Hi guys, first of all thanks for this amazing tool! Glad to see it taking the Python world by storm.
This is a fairly minor style change request.
The formatting I take issue with occurs during item assignment. When the assignment exceeds the line length and the RHS has no "required" parentheses to break on, it chooses to break on the square brackets on the LHS of the assignment:
Personally I think this is really ugly - looking at this expression, it is not immediately obvious that an assignment is happening, since the
=
is moved to the 3rd line. Of all the non-blacked code I've ever read, not one line has ever been formatted like that, which tells me it's not totally human-friendly.My desired result for the above input would be like the following:
Obviously for the cases where my desired behaviour would still result in the 1st line being longer than the desired line length, the current behaviour should be applied.
My current workaround for this styling caveat is to use
dict.update()
instead (though obviously this isn't a general solution since__setitem__
is not exclusive to MutableMappings):The text was updated successfully, but these errors were encountered: