[Python-ideas] [Python-Dev] If you shadow a module in the standard library that IDLE depends on, bad things happen

Michael Selik mike at selik.org
Wed Nov 4 22:35:56 EST 2015


Placing current working directory at the beginning of sys.path or the end
of sys.path is a tradeoff between two debugging tasks given the error
message, `AttributeError: 'module' object has no attribute 'blah'`. The
traceback tells you the name of the module. Which would you prefer: (1)
needing to notice that you made a module of the same name, or (2) needing
to notice that somewhere in the cryptic locations on sys.path there's a
module of the same name?

I'll pick option 1. Sure, it's tricky the first time it happens, but I've
seen complete beginners figure it out after a few minutes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20151105/c04562a8/attachment.html>


More information about the Python-ideas mailing list