(Serious?) package namespace problem (and a proposal)

Justin Sheehy dworkin at ccs.neu.edu
Wed Jun 28 18:03:46 EDT 2000


hzhu at knowledgetrack.com (Huaiyu Zhu) writes:

> from AAA import *
> from BBB.AAA import * 

[various convoluted issues]

"Doctor, it hurts when I do this."

"Don't do that, then."

I'd be quite happy if the 'from' version of import was just not
available at all, except perhaps in interactive mode.

Import your modules directly and you don't have to deal with this kind 
of problem.  As a side effect, your code is usually clearer.

This is a good general rule.  Just don't use 'from' in programs or
modules unless you have a really good reason to.

-Justin

 




More information about the Python-list mailing list