black
black copied to clipboard
Black not line wrapping tuples with long strings
Describe the bug
Black should put parentheses and wrap this tuple over multiple lines:
def asdf():
for item in items:
yield item, "this is a really long string describing item. you'd expect black to put parentheses around the tuple."
To Reproduce
https://black.vercel.app/?version=stable&state=_Td6WFoAAATm1rRGAgAhARYAAAB0L-Wj4ADxAK5dAD2IimZxl1N_WlbvK5V8JNI77iY4W6dVOfyLjNFiaj70Bl3KDmvzUGa515Sxf8PkVW3bG3ae8JNP373LwFgPbvHVIPAE-XJtpbaXte5disESbEB-JtiPSKxPO0dJ9-wDbroDvrdVhhvDMK9VMixYumgWDHNgwfYwkhJSr-_yuGqWhJUZw_mE17rS3JC6V278eYev_bAfCNjaRI2eyTB4Xyv47363qrV197jUTm0eAAAAAOLHMH_IDVfUAAHKAfIBAACkdOtjscRn-wIAAAAABFla
Reproduces even in --preview
mode, which should probably split the string.
I can confirm the same behaviour for strings inside tuples:
(
True,
False,
(
"asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjkl",
"asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjkl"
),
"asdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjklasdfghjkl",
)
Also in --preview
mode