[Python-Dev] ImportWarning flood

Aahz aahz at pythoncraft.com
Sat Jun 24 16:27:15 CEST 2006

On Sat, Jun 24, 2006, Jean-Paul Calderone wrote:
> I am very unhappy that the burden of understanding Python's package
> structure is being pushed onto end users in this way.  Several of my
> projects now emit three or four warnings on import now.
> The Twisted plugin system relies on the fact that directories without
> __init__ are not Python packages (since they _aren't_, have never
> been, and it has always been extremely clear that Python will ignore
> them).
> Of course, Twisted is a pretty marginal Python user so I'm sure no one
> cares.

Then again, bringing this back to the original source of this change,
Google is a pretty marginal Python user, too.  ;-)

I was a pretty strong -1 on the original proposed change of allowing
import on empty directories, but my take is that if a project
deliberately includes empty directories, they can add a new warning
filter on program startup.  Your users will have to upgrade to a new
version of the application or do a similar fix in their own
sitecustomize.  I don't consider that a huge burden.
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"I saw `cout' being shifted "Hello world" times to the left and stopped
right there."  --Steve Gonedes

More information about the Python-Dev mailing list