[Python-Dev] ImportWarning flood
exarkun at divmod.com
Sat Jun 24 16:00:05 CEST 2006
On Sat, 24 Jun 2006 11:47:19 +0200, "\"Martin v. Löwis\"" <martin at v.loewis.de> wrote:
>Ralf W. Grosse-Kunstleve wrote:
>> --- "Martin v. Löwis" <martin at v.loewis.de> wrote:
>>> I don't know. Whether a warning is a problem is a matter of attitude, also.
>> Our users will think our applications are broken if they see warnings like
>> that. It is not professional.
>Actually, your application *was* pretty close to being broken a few
>weeks ago, when Guido wanted to drop the requirement that a package
>must contain an __init__ file. In that case, "import math" would have
>imported the directory, and given you an empty package.
But this change was *not* made, and afaict it is not going to be made.
So the application is not broken, and the warning is entirely spurious.
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
More information about the Python-Dev