A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-January/076066.html below:

[Python-Dev] PEP: Post import hooks

[Python-Dev] PEP: Post import hooks [Python-Dev] PEP: Post import hooksNick Coghlan ncoghlan at gmail.com
Thu Jan 10 10:22:58 CET 2008
Christian Heimes wrote:
> A module is successfully loaded
> '''''''''''''''''''''''''''''''
> 
> The import machinery checks if sys.post_import_hooks contains post import
> hooks for the newly loaded module. If hooks are found then the hooks are
> called in the order they were registered with the module instance as first
> argument. The processing of the hooks is stopped when a method raises an
> exception. At the end the entry for the module name is removed from
> sys.post_import_hooks, even when an error has occured.

Doesn't the module remain in post_import_hooks, only mapped to None to 
indicate that any hooks should be run immediately? (Finding an object in 
sys.modules isn't enough, due to the possibility of it being a 3rd party 
lazy module rather than the actual module).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4