google / google/yapf

Unaligned lambdas in while loop body

Open
#601 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
14k
Forks
904
PR merge metrics
No merged PRs in 30d

Description

yapf (tested with 2c13f6f93e8ccfa0c966b67f88eeffe20ccb32a0) turns the following:

```python
while A(
b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
(lambda: b"\x00\x00\x00"),
):
pass
```

Into the following:

```python
while A(
b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
(lambda: b"\x00\x00\x00"),
):
pass
```

pycodestyle calls this "E131 continuation line unaligned for hanging indent" but honestly it mostly just looks strange. Maybe I'm missing something but it seems very surprising to give the two arguments different indentation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.