import hooks (PEP 302) broken in Python >=2.5?

Ryan Kelly ryan at rfk.id.au
Mon Aug 8 00:03:22 CEST 2011


On Sun, 2011-08-07 at 11:11 -0700, Josh Haberman wrote:
> When reading about import hooks, I came across a blog entry comment
> that says:
> 
>   One additional thing to note about ihooks is that it's
>   somewhat seriously broken on Python 2.5 and newer and there
>   seems to be little or no interest in fixing it. It's
>   probably worth *always* avoiding when writing new code.
> 
> --http://orestis.gr/blog/2008/12/20/python-import-hooks/#c264
> 
> Does anyone know what this is referring to?  Should I be wary of
> relying on import hooks?

I believe that comment is referring specifically to "ihooks" the stdlib
module, not "import hooks" the general concept as defined in PEP302.
The former pre-dates the later.

I use custom PEP302 loaders all the time and they work fine in at least
2.6, 2.7 and 3.2.


  Ryan

-- 
Ryan Kelly
http://www.rfk.id.au  |  This message is digitally signed. Please visit
ryan at rfk.id.au        |  http://www.rfk.id.au/ramblings/gpg/ for details

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://mail.python.org/pipermail/python-list/attachments/20110808/45272834/attachment.sig>


More information about the Python-list mailing list