[Python-checkins] r64651 - sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py

Nick Edds nedds at uchicago.edu
Sat Jul 5 19:16:54 CEST 2008


Brett,

If you want me to try and make this a fixer, I can give it a shot over the
next few days because I'm already fairly comfortable with fixers in 2to3. I
think based on the revision that was attempted and what I've read online, I
have a pretty good idea of what needs to be done with this fixer. Hopefully
I'll have the time to get this done by Monday or Tuesday if you'd like me to
do it.

Regards,
Nick

On Sat, Jul 5, 2008 at 11:58 AM, Brett Cannon <brett at python.org> wrote:

> On Fri, Jul 4, 2008 at 6:22 PM, Collin Winter <collinw at gmail.com> wrote:
> > On Tue, Jul 1, 2008 at 7:00 PM, brett.cannon <python-checkins at python.org>
> wrote:
> >> Author: brett.cannon
> >> Date: Wed Jul  2 04:00:11 2008
> >> New Revision: 64651
> >>
> >> Log:
> >> Update fix_imports for urllib. Had to change the fixer itself to handle
> modules
> >> that are split across several renames in 3.0.
> >
> > So I realize that you already reverted this, but I thought to comment
> > anyway: this implementation is almost certainly wrong. Any fixer for
> > this particular PEP 3108 change will need to possibly insert extra
> > imports to handle the new urllib.request/error/etc modules. I think
> > this kind of thing should be broken into its own fixer, or at least
> > its own distinct functionality inside of fix_imports.
> >
>
> OK. I will see if I can figure out how this works at some point.
>
> > Nick Edds is working to speed up fix_imports by stripping out the
> > member matching stuff, which we don't believe to be actually useful in
> > the majority of module renamings. IMHO there should be two different
> > mappings: one for bare-bones module renames (StringIO -> io), and a
> > separate one for more complex renames, like urllib/urllib2. That will
> > allow optimizing the former larger pattern while preserving
> > flexibility for the rare cases in the latter.
> >
>
> Makes sense.
>
> -Brett
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-checkins/attachments/20080705/f44e89e1/attachment.htm>


More information about the Python-checkins mailing list