I sometimes have to write something like
from blqblq.lqlqlqlq.bla import fobarbazbarbarbazar as foo
from matplotlib.backends.backend_qt4agg import FigureCan
This is the PEP8 documentation for long imports:
Currently, if you want to import a lot of names from a module or package, you have to choose one of several unpalatable options:
Write a long line with backslash continuations:
from Tkinter import Tk, Frame, Button, Entry, Canvas, Text, \
LEFT, DISABLED, NORMAL, RIDGE, END
Write multiple import statements:
from Tkinter import Tk, Frame, Button, Entry, Canvas, Text
from Tkinter import LEFT, DISABLED, NORMAL, RIDGE, END
( import * is not an option ;-)
Instead, it should be possible to use Python's standard grouping mechanism (parentheses) to write the import statement:
from Tkinter import (Tk, Frame, Button, Entry, Canvas, Text,
LEFT, DISABLED, NORMAL, RIDGE, END)
This part of the proposal had BDFL approval from the beginning.
Parentheses support was added to Python 2.4.