Suggest starting multi-line imports on the next line to pass flake8 (#923)

This commit is contained in:
Brett Sun 2016-12-20 18:30:42 +01:00 committed by GitHub
parent 7e33f2bd52
commit 151d1c5a0c
1 changed files with 8 additions and 1 deletions

View File

@ -47,8 +47,15 @@ It seems the preference is for slashes, but using parentheses is okay too. (Ther
If you need to `import` lots of names from a module or package, and they won't all fit in one line (without making the line too long), then use parentheses to spread the names across multiple lines, like so:
```python
from Tkinter import (
Tk, Frame, Button, Entry, Canvas, Text,
LEFT, DISABLED, NORMAL, RIDGE, END,
)
# Or
from Tkinter import (Tk, Frame, Button, Entry, Canvas, Text,
LEFT, DISABLED, NORMAL, RIDGE, END)
LEFT, DISABLED, NORMAL, RIDGE, END)
```
For the rationale, see [PEP 328](https://www.python.org/dev/peps/pep-0328/#rationale-for-parentheses).