[Tutor] Can't figure out why this is printing twice

Wayne srilyk at gmail.com
Tue Jun 9 15:49:46 CEST 2009

On Tue, Jun 9, 2009 at 8:31 AM, Lie Ryan <lie.1296 at gmail.com> wrote:

> Maybe python should issue some kind of warning when a module being
> imported from a local path has the same name as an installed module? It
> is never a good idea to name a module the same as an installed library
> unless you're deliberately trying to shadow the library for some reason
> (in which case you're a fully consenting adult).
so I guess it would search the library, then local path, and warn and import
if it finds from the local path?

That's one thing that would be useful to borrow from C(?)/C++ - if you
import <somelib> then it only looks in the standard location. If you import
"somelib" then it looks in the local path and if it's not found it looks in
the standard location. I think there's some other syntax that only looks for
the library locally, too.

I wonder what the BDFL would/has said.

/me wanders off to see what he can find...

To be considered stupid and to be told so is more painful than being called
gluttonous, mendacious, violent, lascivious, lazy, cowardly: every weakness,
every vice, has found its defenders, its rhetoric, its ennoblement and
exaltation, but stupidity hasn’t. - Primo Levi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090609/5711c745/attachment.htm>

More information about the Tutor mailing list