yapf gets confused when a dict literal has lambdas as values
Open
- Dominant language
- Python
- Stars
- 14k
- Forks
- 904
- PR merge metrics
- No merged PRs in 30d
Description
Input:
```
{
'a': lambda a, b: True,
'b': lambda c, d: False,
}
```
yapf wants to apply this diff:
```
--- narf.py (original)
+++ narf.py (reformatted)
@@ -1,4 +1,6 @@
{
- 'a': lambda a, b: True,
- 'b': lambda c, d: False,
+ 'a': lambda a,
+ b: True,
+ 'b': lambda c,
+ d: False,
}
```
IOW
```
{
'a': lambda a,
b: True,
'b': lambda c,
d: False,
}
```
Which strikes me as awful. This is with `allow_multiline_lambdas = true` in case that matters. Noticed on the hg codebase, where we're considering using yapf.
Contributor guide
Assessment
This issue has not been assessed yet.