error formatting dict when there is a very long list
- Dominant language
- Python
- Stars
- 14k
- Forks
- 904
- PR merge metrics
- No merged PRs in 30d
Description
When formatting a dict with a very long value, such as a list.
The following case is expected.
```python
{
1: 1,
2: 2,
3: 3,
4:
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51]
}
```
But if the last list of key `4` has 52 elements, it becomes
```python
{
1:
1,
2:
2,
3:
3,
4: [
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
51, 52
]
}
```
Similar problem occurs when
```python
{
1:
1,
2:
2,
3:
3,
4: [
1,
1,
1,
1,
1,
1,
# omit 100 times 1s
1,
1,
1,
1,
1,
]
}
```
encounted at yapf 0.32.0 on linux (Amazon Linux 2 AMI)
Looks like a feature? Do I have a way to aviod this situation?
Contributor guide
Assessment
This issue has not been assessed yet.