[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-dev] [PATCH 3/4] Fixes gps.gps.gps iterator for Python 3.
From: |
Eric S. Raymond |
Subject: |
Re: [gpsd-dev] [PATCH 3/4] Fixes gps.gps.gps iterator for Python 3. |
Date: |
Sun, 17 Apr 2016 00:09:36 -0400 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
Fred Wright <address@hidden>:
>
> On Sat, 16 Apr 2016, Eric S. Raymond wrote:
>
> > Fred Wright <address@hidden>:
> > > Python 3 renames the iterator next() method to __next__(). Without
> > > the new name, attempting to use the object as an iterator doesn't
> > > work. This didn't surface until trying webgps.py.
> >
> > Sounds like this should be acced to Practical Python Porting. Does
> > 2to3 do the method renaming?
>
> Yes, it looks like it does. I never bothered running 2to3 on gps/*.py
> since I assumed you'd already done that in your initial pass, and just
> fixed things that actually failed.
Confirmed. I checked with a sample program. I've added this as a
HOWTO checklist item.
> Of course running 2to3 *now*, it wants to rename the wrapper, which would
> make it completely broken. It should really be called 2to3only, since it
> complains about anything you try to do for Python 2 compatibility. :-)
Yeah. If I get enough round tuits I'm going to write a patch for 2to3
that allows you to specify either 2.7-compatibility changes or 2.7-to-3
changes only.
--
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>