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

Huaiyu Zhu hzhu at knowledgetrack.com
Wed Jun 28 18:42:33 EDT 2000


On 28 Jun 2000 18:03:46 -0400, Justin Sheehy <dworkin at ccs.neu.edu> wrote:
>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."

What it hurts is to import BBB/AAA.py instead of AAA.py.  I'd be interested
in how do you "Don't do it".


>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 has nothing to do with my code.  How about

import AAA

Does it solve the problem at all? 

<rant>
It appears that if someone is objecting to a certain idiom then he'll
automatically think that's the cause of whatever problem anyone else is
writing about, as long as it appears somewhere.
</rant>

Please read my original post.  I was discussing a completely different issue.

To avoid any further unnecessary digressions, I state my actual problem
here.  I'm developing the MatPy pacakge which works quite well on Linux and
Solaris, but some Windows user's keep complaining about name clashes.  It
turns out that I have, in the file MatPy/gnuplot.py, this line

from Gnuplot import Gnuplot

Since on Windows Gnuplot.py and gnuplot.py is indistinguishable, this line
tries to import itself!  

Now could any one that think the problem can go away suggest a solution that
does not need to change file names and still works on Windows.

Huaiyu


-- 
Huaiyu Zhu                       hzhu at users.sourceforge.net
Matrix for Python Project        http://MatPy.sourceforge.net 



More information about the Python-list mailing list