Why bother to limit the types imported from a python package?
Posted
by
Fast Fish
on Stack Overflow
See other posts from Stack Overflow
or by Fast Fish
Published on 2011-03-05T15:11:20Z
Indexed on
2011/03/05
15:24 UTC
Read the original article
Hit count: 254
python
When using many IDEs that support autocompletion with Python, things like this will show warnings, which I find annoying:
from eventlet.green.httplib import BadStatusLine
When switching to:
rom eventlet.green.httplib *
The warnings go away. What's the benefit to limiting imports to a specific set of types you'll use? Is the parsing faster? Reduces collisions? What other point is there? It seems the state of python IDEs and the nature of the typing system makes it hard for many IDEs to fully get right when a type import works and when it doesn't.
© Stack Overflow or respective owner