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
#3440 (closing #620 and #808) improved handling of long expressions in dict values by putting them in parentheses, but the same values in function arguments aren't always handled nicely.
Examples in the current Black style
dict(
key_key_key_key=a_long_long_long_long_long*b_long_long_long_long_long/100.0
)
dict(
key_key_key_key_key_key_key_key_key=lambda: some_very_long_function_name(
x, y, z
)
)
The above problem surprisingly isn't present when the expression is the ternary operator. I found this related issue: #2248, and I think it could be closed now, as on the --preview on main it's fixed.
Here's a comparison of some structures where formatting is good and not good:
Without preview enabled, cases A-J excluding E are ugly, with preview enabled only C, D, I and J are ugly (and these are the examples presented above).
The text was updated successfully, but these errors were encountered:
Describe the style change
#3440 (closing #620 and #808) improved handling of long expressions in dict values by putting them in parentheses, but the same values in function arguments aren't always handled nicely.
Examples in the current Black style
Desired style
Additional context
The above problem surprisingly isn't present when the expression is the ternary operator. I found this related issue: #2248, and I think it could be closed now, as on the --preview on main it's fixed.
Here's a comparison of some structures where formatting is good and not good:
https://black.vercel.app/?version=main&state=_Td6WFoAAATm1rRGAgAhARYAAAB0L-Wj4AVtAZFdAD2IimZxl1N_Wg0-DjgFSwwpr4QAHGnZVCigXiEsaw3kDKWOCEa4OyVpau2mCKO2huSgEtYJFakCvJdOz0Tnz9A9VXZaY6yvVt0g0T7eVV1sdafqJHPQjFCF87XgeS5o61J0hfwUrJyv9vemJ3drIV67OMA4NPtoBxDB0jAnP0w3_FCw4CwHZNzHatn3Mmo8JDZbQgL9tZuHGhbY93lVPrMOOj7V13lJpYG7iN4EAeOxV-wIMLcnBSj9dt2P1447cRZOFBAPbIbLCz6KCdzbNRgUw7Z2AoNrHepi73I-BQJ-tVCrypINXFeYTLtWI5ijTFPZ_c48_7tnfGJvb9lSt20aVWHGlcDJzbeHWZA5x90aMTtBD_YqD4xSuSyF2kcLxHFGTemWtI7jxvkqSbsB1L1TVuEqG1ERUBH7wYVedEYUorPtewAk13xN8SdhklZ3xTKO_WsKJ2NSK4bvFkLnxJuMSyIlc0tGdWdyFUdJub9EJwuKoneabBy__ez6gsL3D1DbXrAxE-ETk4_7yaQi0S4AAAAAAK98cuj9XVqQAAGtA-4KAADgH0AascRn-wIAAAAABFla
Without preview enabled, cases A-J excluding E are ugly, with preview enabled only C, D, I and J are ugly (and these are the examples presented above).
The text was updated successfully, but these errors were encountered: