Imperfections in ihooks.py?

Gordon McMillan gmcm at hypernet.com
Fri Apr 16 13:53:20 EDT 1999


[Michael Hudson messes with ihooks and /F points him to Greg's 
imputil.py at http://www.lyra.org/greg/small/ ]:

> Ah! Fantastic!
> 
> Usual case; I start to think about a problem, ask about it and find
> someone else has solved the problem already.
> 
> Not perfection yet though - imputil.py contains these lines:
> 
>   def _reload_hook(self, module):
>     raise SystemError, "reload not yet implemented"
> 
> which was one of the things I was moaning about in my post.

Greg is being bad. First, that page hasn't been updated with the link 
to my installer (www.mcmillan-inc.com/install.html), and his 
imputil.py doesn't have my patch. Said patch doesn't implement 
reload, but it does at least determine whether the reload request is 
for a module under the hook's control. If not, it passes the request 
on.

I looked at what it would take to implement reload. It didn't look 
_that_ bad. However, for my purposes (serving modules from an 
archive) it just didn't make much sense. I mean, we're talking about 
an alternative to freeze after all...

Nits aside, imputil.py is a truly outstanding piece of code.

- Gordon




More information about the Python-list mailing list