[SciPy-Dev] PR 397: Getting rid of 2to3 (single codebase for Python 2 & 3)

josef.pktd@gmai... josef.pktd@gmai...
Sat Jan 5 14:54:17 CST 2013


On Sat, Jan 5, 2013 at 2:15 PM, Pauli Virtanen <pav@iki.fi> wrote:
> Hi,
>
> Prompted by this:
>
>
> http://jakevdp.github.com/blog/2013/01/03/will-scientists-ever-move-to-python-3/#comment-755694121
>
> here's a conversion of the Scipy code base runnable on Python 2.6 and
> 3.x without 2to3:
>
>     https://github.com/scipy/scipy/pull/397
>
> That was fairly easy to do, and I suspect the case is the same for Numpy.
>
> But do we want to go this way? On the one hand, this is a cleaner way to
> go than relying on 2to3 --- which does not convert all semantic
> differences and can lead to some subtle bugs...
>
> On the other hand, well, you have to add list() around map() et al. to
> make them lists, and have to import xrange, izip et al. from a
> compatibility module.
>
> To me, overall, this doesn't look like a bad route to go. Thoughts?

I looked through your changes in scipy stats. They don't look too
difficult and I don't see a reason not to switch to this.

Some things might be difficult to remember and might slip through pull requests.

For example for statsmodels I need to do compatibility fixes (with
python and older numpy) at irregular intervals, which got easier
however with having python 3 tested by TravisCI.

Josef


>
>         Pauli
>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev


More information about the SciPy-Dev mailing list