google / google/yapf

W503: yapf inserts line break before rather than after a '-' binary operator

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

Description

There is no option that I can find for this, unlike #38 and #252.

Code:

```python
import inspect

def get_default_of(func, argname):
argspec_of_func = inspect.getargspec(func)
return argspec_of_func.defaults[argspec_of_func.args.index(argname) - len(argspec_of_func.args)]
```

Result:

```python
import inspect

def get_default_of(func, argname):
argspec_of_func = inspect.getargspec(func)
return argspec_of_func.defaults[argspec_of_func.args.index(argname)
- len(argspec_of_func.args)]
```

This yields W503 for pyflakes: line break before binary operator.

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.