[IPython-dev] [sympy] Treating Python 3 as a first-class citizen
fperez.net at gmail.com
Fri Aug 9 16:25:28 EDT 2013
On Mon, Aug 5, 2013 at 9:05 PM, Ondřej Čertík <ondrej.certik at gmail.com> wrote:
> Fernando, I would be very much interested what you think of this
> issue, as you have more touch with the Python core devs.
I don't really have any particular insights on this one. But I am
concerned about the fact that, even with a unified 2/3 codebase (which
I agree is the right approach and which we'll move towards in
IPython), we're going to be living in this funky 2+3 (5 ?) ghetto for
a long time to come. It's true that we can now write single-codebase
codes, esp. cleanly if we're willing to drop both 2.6 and 3.2. But
that means not using any of the new and sometimes appealing features
of the language, like 'yield from', function type annotations, or new
features in the library like concurrent.futures.
This means that 2.x support is going to be a drag into people really
embracing python 3 for a long time to come, since I'm sure that many
projects will be reluctant to completely drop 2.x support altogether.
If you ask me, the strategy to encourage py3 adoption should have been:
1. Provide the 2to3 tool meant mostly as a one-time use tool to help
projects make the initial transition, assuming that it would require
manual cleanup afterwards.
2. Provide a 3to2 tool meant to run at installation time automatically
when setup.py detects it's getting run via python2. This could do
whatever ugliness is necessary to emit python2-compatible code,
possibly along shimming in a backports module along the lines of six.
If this had been done, we'd all move happily along to python3, knowing
that (perhaps with a bit of care to ensure we don't fall outside the
scope of what 3to2 could do) we could support our 2.x user base
I know that such a hypothetical 3to2 isn't an easy job, but honestly
given the years of slowing down of Python development the 3 transition
has costed everyone, and the amount of grief and pleading for projects
to move forward, I think it would have been a very worthwhile
investment. I'm willing to bet it would massively speed up 3
adoption, and re-invigorate Python development.
But hey, that's just my opinion. I'm not in the core team and I'm not
the one who is going to do the work, so I have little right to
complain. They have their priorities and I'm very grateful for the
fact that on many fronts they do a spectacular job, so unless I'm
going to roll up my sleeves and do something about this, I should
probably shut up :)
Fernando Perez (@fperez_org; http://fperez.org)
fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
fernando.perez-at-berkeley: contact me here for any direct mail
More information about the IPython-dev