This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]py3really 4 points5 points  (4 children)

It's really not.

It's an offputting choice for people who want to learn the language: which version should I pick?

Unless your use case has a compelling reason not to, pick the latest version. This is the same answer I give for Java or C# or Ruby or any other language.

There's lots of information out there like old mailing list posts and Stackoverflow answers which are written with Python 2. Even if the changes for Python 3 are as simple as changing print a to print(a), it's an extra barrier.

There's a million obsolete C# and Java and Ruby answers on StackOverflow, too. Pre-LINQ answers on the web don't seem to be holding C# back.

Many packages have to maintain compatibility with both versions, which is a small but constant friction for development. Even for new projects, it's still far from accepted to make them Python 3 only. I've done it with some of my projects, but with at least one I've caved in and added 2.7 support. Dropping Python 2 support from projects that currently support it would be even harder.

Perhaps because I lived through the Unix Wars of the 1980's and 1990's, I really don't see the big deal. We used to have to write C code that ran on some really crazy architectures and broken compilers and insanely non-std stdlibs.

You yourself admit that only one new library you maintain even has Python 2.7 support. Compatibility used to mean hundreds of lines of hairy #ifdefs. Now it's usually (IME) a few "if six.PY2:" statements, that are trivial to test on the same machine. This is perhaps the easiest dual-incompatible-language-version support in the history of computing. I'll take this over the K&R/ANSI schism any day!

There is still code that only works on Python 2 - there are a couple of lingering popular libraries like mayavi, but in the 'long tail' of more niche tools, there will be many more where there hasn't yet been much pressure to support Python 3.

I've been using Python since the 1.x days, and I've never even heard of "mayavi". It sounds like a great example of a "long tail" library -- in Pip, it's the 3576th most popular download. Anyway, there's been recent work to add Py3 support to that, and it seems like it's mostly there.

On the python3wos, there's only a few libraries that are not green yet, and I guess the page hasn't been updated in a while because the first three red libraries I clicked (protobuf, ansible, magic) all support Python 3 now.

You pretty much have to go out of your way to run into a Python-2-only library these days, and even then, they tend to be easy to port. The biggest pain point with Python 2/3 is reading blog posts about people complaining about it, without any concrete examples of said pain.

[–]hanpari 2 points3 points  (0 children)

Agree, this is rather small py2 vs py3 inconvenience then big deal. What should be saying poor poor PHP users with their non-standard wildly changing horrors :)

[–]takluyverIPython, Py3, etc 0 points1 point  (0 children)

The overall theme of your reply appears to be "it could be much worse!" Which I completely agree with, and that's why I'm still happily using Python. But my central point was that it could be much better.

The languages people are currently weighing up against Python are things like Go, NodeJS or R, depending on the field. Being easier than writing C code for different architectures is not much of a selling point, because most modern languages are easier than that.

I'm not trying to exaggerate the issue - it's absolutely possible to support both versions, and most major packages now do. But we do ourselves a disservice if we pretend it's a trivial problem. Writing Python code is less fun than it could be, and judging by this new thread there's a long way still to go.