[Python-3000] Interest in PEP for callbacks on module import

Jim Jewett jimjjewett at gmail.com
Mon Dec 10 02:22:38 CET 2007


On 12/9/07, Christian Heimes <lists at cheimes.de> wrote:

> The touch points between post import hooks and lazy imports
> are minimal.

Could you give me a use-case for post-import hooks *without* lazy imports?

As nearly as I can tell, either

(1)  The module is already loaded (and the whole infrastructure is overhead)

(2a)  You will be importing the module.  Then you can just run your
hooks directly without any infrastructure.

(2b)  You will not be importing the module you need to hook -- in
which case I think you want laziness as well.

-jJ


More information about the Python-3000 mailing list