"Guido van Rossum" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > (Context: There's a large crowd with pitchforks and other sharp pointy > farm implements just outside the door of my office at Google. They are > making an unbelievable racket. It appears they are Google engineers > who have been bitten by a misfeature of Python, and they won't let me > go home before I have posted this message.) > > One particular egregious problem is that *subpackage* are subject to > the same rule. It so happens that there is essentially only one > top-level package in the Google code base, and it already has an > __init__.py file. But developers create new subpackages at a > frightening rate, and forgetting to do "touch __init__.py" has caused > many hours of lost work, not to mention injuries due to heads banging > against walls. >
It seems to me that the right way to fix this is to simply make a small change to the error message. On a failed import, have the code check if there is a directory that would have been the requested package if it had contained an __init__ module. If there is then append a message like "You might be missing an __init__.py file". It might also be good to check that the directory actually contained python modules. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com