(Serious?) package namespace problem (and a proposal)
Nhi Vanye
offer at sgi.com
Wed Jun 28 19:31:25 EDT 2000
$ from NO_SPAM_hzhu at knowledgetrack_dot_com -#96726 | sed "1,$s/^/> /"
>
>
>
>>If you don't want python to search the current directory for imports,
>there is a
>>very simple solution: put this snippet above all of your other imports:
>>import sys
>>sys.path.remove('.')
>>
>
>This might be fine for personal use. But I'm developing a general package
>that is being used by many people. I don't think it's safe to fiddle with
>that. And as I said, the functionality of packages can not (and absolutely
>should not) depend on the order of sys.path. Otherwise packages expecting
>different ordering of sys.path cannot be used together.
It does on unix... If I type sh, the shell I get is going to completely
depend on what my path is.
If I want (as a user) to control which version I want I can use
/bin/sh. As an system admin I can't enforce that that is the only version
of sh on the system.
The same logic applies with python imports.
>
>
>Huaiyu
richard.
--
Richard Offer Widget FAQ --> http://reality.sgi.com/widgetFAQ
MTS-Core Design (Motif)
___________________________________________http://reality.sgi.com/offer
More information about the Python-list
mailing list