[Python-Dev] Python 2.x and 3.x use survey, 2014 edition

Ben Finney ben+python at benfinney.id.au
Tue Dec 16 06:00:57 CET 2014


Mark Roberts <wizzat at gmail.com> writes:

> So, I'm the guy that used the "hate" word in relation to writing 2/3
> compliant code. And really, as a library maintainer/writer I do hate
> writing 2/3 compatible code.

You're unlikely to get disagreement on that. I certainly concur.

The catch is, at the moment it's better that any of the alternatives for
writing medium-to-long-term maintainable Python code.

> The whole situation is made worse because I *KNOW* that Python 3 is a
> better language than Python 2, but that it doesn't *MATTER* because
> Python 2 is what people are - and will be - using for the foreseeable
> future.

Only if “people” means “any amount of people at all who are or might be
using Python”.

While developers might like something that allows them to serve such a
broad user base indefinitely, it's simply not realistic – and *no*
feasible support strategy for Python could allow that.

So, as developers writing Python code, we must set our expectations for
support base according to reality rather than wishing it were otherwise.

> It's impractical to drop library support for Python 2 when all of your
> users use Python 2

Right. The practical thing to do is to decide explicitly, per project,
what portion of those users you can afford to leave behind in
Python-2-only land, and how much cost you're willing to bear to keep
than number low.

> I suppose what I'm saying is that there's lots of claims that the
> conversion to Python 3 is inevitable, but I'm not convinced about
> that.

I've never seen such a claim from the PSF. Can you cite any, and are
they representative of the PSF's position on the issue?

Rather, the claim is that *if* one's code base doesn't migrate to Python
3, it will be decreasingly supported by the PSF and the Python community
at large.

Happily, what's also true is there is a huge amount of support – in
language features, tools, and community will – to help developers do
that migration. Much more than most other migrations I've observed.

So what's inevitable is: either a code base will benefit from all that
support and be migrated to Python 3 and hence be maintainable as the
Python ecosystem evolves; or it will be increasingly an outsider of that
ecosystem.

-- 
 \           “I have one rule to live by: Don't make it worse.” —Hazel |
  `\                                                          Woodcock |
_o__)                                                                  |
Ben Finney



More information about the Python-Dev mailing list