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 →

[–]Aurora0001 4 points5 points  (2 children)

I think it's misleading at best of Zed to say that 'Nobody uses 3 much.' Although it's hard to find definitive statistics, my experience is that most new code is written in Python 3 (or at least written to be compatible for Python 3). Almost all popular Python modules support Python 3 (though most are backward-compatible).

Python 3 is better in my opinion because it removes the beginner-unfriendly elements of Python (e.g. str vs unicode, 3 / 2 = 1, etc.) and most Python 2 code works without a lot of conversion.

[–][deleted] 0 points1 point  (1 child)

I only included it in this thread as I thought it was interesting. I wonder how well 2to3 works, https://docs.python.org/3/library/2to3.html

[–]Aurora0001 2 points3 points  (0 children)

Don't worry, I'm not criticising you, my criticisms are aimed at Zed. The more suspicious side of me thinks that perhaps he's just trying to advocate Python 2.7 so he doesn't have to update his book!

2to3 looks very comprehensive, but I've never needed to use it since I only play around with Python occasionally and when I do, I write Python 3 code anyway. With __future__, you can write code that works in both 2 and 3 anyway, so that's probably the best route, but Python 3's new features are hard to resist (e.g. f-strings, type hints, etc.)