import bug

kj no.email at please.post
Sat Oct 31 17:27:20 CET 2009


In <4aec591e$0$7629$9b4e6d93 at newsspool1.arcor-online.net> Stefan Behnel <stefan_ml at behnel.de> writes:

>kj, 31.10.2009 16:12:
>> My sin appears to be having the (empty) file ham/re.py.  So Python
>> is confusing it with the re module of the standard library, and
>> using it when the inspect module tries to import re.

>1) it's a bad idea to name your own modules after modules in the stdlib

Obviously, since it leads to the headaches this thread illustrates.
But there is nothing intrisically wrong with it.  The fact that it
is problematic in Python is a design bug, plain and simple.  There's
no rational basis for it, and represents an unreasonable demand on
module writers, since contrary to the tight control on reserved
Python keywords, there does not seem to be a similar control on
the names of stdlib modules.  What if, for example, in the future
it was decided that my_favorite_module name would become part of
the standard library?  This alone would cause code to break.

>2) this has been fixed in Py3

In my post I illustrated that the failure occurs both with Python
2.6 *and* Python 3.0.  Did you have a particular version of Python
3 in mind?

kynn



More information about the Python-list mailing list