[Python-3000] New Import Behavior

Jean-Paul Calderone exarkun at divmod.com
Mon Jan 15 18:56:42 CET 2007


On 2007年1月15日 12:24:01 -0500, Barry Warsaw <barry at python.org> wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>>On Jan 15, 2007, at 12:17 PM, Armin Ronacher wrote:
>>> `thirdparty` is in the pythonpath, the folder where in `yourapp` is
>> in too.
>> If now someone tries to import `yourapp.plugins.plugin3` this would
>> not work
>> because python stops the import process somewhere in `yourapp/
>> plugins/` not
>> trying the `thirdparty` folder at all. For plugin systems this is
>> very bad. Java
>> solves that better.
>>Use __path__

For example:
 http://twistedmatrix.com/trac/browser/trunk/twisted/plugins/__init__.py
Jean-Paul


More information about the Python-3000 mailing list

AltStyle によって変換されたページ (->オリジナル) /