[Python-Dev] Install Hook [Was: Re: PEP 414 updated]
Armin Ronacher
armin.ronacher at active-4.com
Sun Mar 4 23:44:30 CET 2012
Hi,
On 3/4/12 9:00 PM, Vinay Sajip wrote:
> I realise that the implementation is different, using tokenize rather than
> lib2to3, but in terms of its effect on the transformed code, what are the
> differences between this hook and running 2to3 with just the fix_unicode fixer?
I would hope they both have the same effect. Namely stripping the 'u'
prefix in all variations.
Why did I go with the tokenize approach? Because I never even
considered a 2to3 solution. Part of the reason why I wrote this PEP was
that 2to3 is so awfully slow and I was assuming that this would be
largely based on the initial parsing step and not the fixers themselves.
Why did I not time it with just the unicode fixer? Because if you look
at how simple the tokenize version is you can see that this one did not
take me more than a good minute and maybe 10 more for the distutils hooking.
Regards,
Armin
More information about the Python-Dev
mailing list