Open SylvainDe opened 1 year ago
Hi,
I think I'm experiencing a similar issue.
Take this code:
if a:
if b:
foo = {
True: {
xxx: zzzzz
for xxx, zzzzz in self.very_long_name_because_oor_project_is_like_this_and_important_.items()
if xxx not in another_very_long_name_i_need_it__[True].keys()
},
}
When I run black with --line-length 100
it does not change anything, leaving the line over 100 symbols. I think there is a way to format it:
if a:
if b:
foo = {
True: {
xxx: zzzzz
for xxx, zzzzz
in self.very_long_name_because_oor_project_is_like_this_and_important_.items()
if xxx not in another_very_long_name_i_need_it__[True].keys()
},
}
However, black formats it back to longer line.
I'm using black from pypi
black, 23.1.0 (compiled: yes)
Python (CPython) 3.9.10
Still reproduced on Main: https://github.com/psf/black/commit/a20338
Not sure if a real issue nor if it is a known issue.
Black https://github.com/psf/black/commit/196b1f
Playground link
Options
--line-length=88
--safe
--target-version=py310
Input
Output
Expected
Note
Using the "--preview" options gives something which is more like what I'd expect: