On Tue, Aug 19, 2008 at 6:12 PM, Yuri Baburov <[EMAIL PROTECTED]> wrote:
> On Tue, Aug 19, 2008 at 5:55 PM, Graham Dumpleton
> <[EMAIL PROTECTED]> wrote:
>> On Aug 19, 8:32 pm, "Yuri Baburov" <[EMAIL PROTECTED]> wrote:
>>> Hi devs,
>>>
>>> Happily there's ihooks.py that does 99% of work (and a bit more).
>>>
>>> Please see ticket and applied 
>>> patch:http://code.djangoproject.com/ticket/8413
>>> Working for me on windows and linux.
>>
>> Hmmm, I thought one had to be careful using ihooks going forward. I
>> thought:
>>
>>  http://www.python.org/dev/peps/pep-0302/
>>
>> defined proper way of doing things now. The PEP says:
>>
>> Forward Compatibility
>>    Existing __import__ hooks will not invoke new-style hooks by
>> magic,
>>    unless they call the original __import__ function as a fallback.
>>    For example, ihooks.py, iu.py and imputil.py are in this sense not
>>    forward compatible with this PEP.
>>
>> I haven't got source code for Python to look at at moment to work it
>> out.
> Well, I have read this PEP carefully, but there was no any clean
> example of using it.
> Now I see I overlooked that there's test/test_importhooks.py in python
> distribution.
> Ok, I will change my code to using PEP 302 hooks instead. It's not
> much work, and the code will look almost the same.

I updated path with PEP-302.
Now it doesn't change __import__ behavior in any way, and there's no
ihooks.py import anymore.
Agree that it's post-1.0 (but it's nice feature anyway!).

-- 
Best regards, Yuri V. Baburov, ICQ# 99934676, Skype: yuri.baburov,
MSN: [EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to