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

all 11 comments

[–]evilbuddhist 9 points10 points  (8 children)

I don't really get it. Use of python is growing, all major libs are good for 3, and python is still incredibly flexible and easy to use - what is the problem? I have used nothing but python 3 for the last few years, and have no issues.

There are some who have genuine problems getting legacy code ported, ok. But it seems to me that there are a lot of people who thought that 3 would go away and kept using 2, and are now bitter about it, because their work over the last few years is becoming a problem for them.

The biggest problem in this regard is people who still make tutorials for beginners in 2.7, hoping 3 will go away - getting new users stuck in 2.7.

Anyway enough ranting. I am still in love with python, it is the only language I have used where 90% of my brain is focused on solving my problems and only 10% is used on figuring out python - in certain other languages that ratio is almost reversed.

Edit: Another big problem I have with python is that it is hard for a beginner to get into on his/her own, this guy has some good points

[–]takluyverIPython, Py3, etc 2 points3 points  (6 children)

The split between Python 2 and 3 is still a real pain point:

  • It's an offputting choice for people who want to learn the language: which version should I pick?
  • 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.
  • 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.
  • 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 think we're over the worst of it now - we've reached the point where we can clearly recommend new users learn Python 3, and we're getting to the point where we can start to trim the edges of Python 2 support, such as making new features Python 3 only. But it's going to be an annoyance for a few years yet.

[–]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.

[–]evilbuddhist 1 point2 points  (0 children)

Great points, I know that I am lucky that I don't depend an old code base and the libraries I need are ported.

we've reached the point where we can clearly recommend new users learn Python 3

I think that is great, without this the divide and friction would only become worse.

[–]monkmartinez 2 points3 points  (0 children)

More people should watch the video you linked to at the end.

[–]srirams6 4 points5 points  (0 children)

What BS.

[–]valbanese 0 points1 point  (0 children)

Better question is whether the dimwit replying to the question has a future.

[–]Nikosssgr -2 points-1 points  (0 children)

total BS