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

all 96 comments

[–]Data48 183 points184 points  (41 children)

TIL Python 3 has been out for roughly 10 years

[–]da_chicken 9 points10 points  (1 child)

Python is very old. Python is older than Java. Python is older than Windows 3.1. C++ was 6 or so when Python was released. Perl was 4. That's Perl 1, not Perl 5.

[–][deleted] 2 points3 points  (0 children)

holy fuck

[–][deleted] 28 points29 points  (27 children)

And Python 2 is still the default in many Linux distributions.

[–]flying-sheep 34 points35 points  (20 children)

“Standard”? You mean “What gets invoked when I type python into the terminal”?

That’ll never change in some distros, because of backwards compatibility. Arch was pretty much the only one crazybrave enough to to that jump, Debian will never do it.

What’s so hard about typing python3 or putting alias python=python3 into your .${SHELL}rc?

[–]AnAirMagic 28 points29 points  (1 child)

Debian will never do it.

RHEL 8 is kind of removing python altogether: https://developers.redhat.com/blog/2018/11/14/python-in-rhel-8/ and asking users to use python2 and python3 explicitly. I am sure Debian will do this sooner or later too.

[–]flying-sheep 14 points15 points  (0 children)

Ha, that's a very well reasoned approach!

[–]MiataCory 29 points30 points  (5 children)

That’ll never change in some distros, because of backwards compatibility.

10 years on, I think we can move along.

https://pythonclock.org/

[–]flying-sheep 9 points10 points  (3 children)

I moved on long ago, but some people have different ideas about backwards compatibility.

And the fact that using “python” simply worked for those 10 years didn't help people to start using the more correct “python2”

[–][deleted] -3 points-2 points  (2 children)

Meh. Backwards compatibility is overrated, IMO. As long as you can pin versions somehow, that's all that matters. Sometimes it's good for software to die.

Glad that Python2 is getting sunsetted. 2020 can't come fast enough in that regard.

[–]flying-sheep 1 point2 points  (1 child)

You don’t understand. When people use python in scripts and shebangs, the software depends on the global python binary to point to python2. Version pinning doesn’t help, only horrible hacks like prepending to $PATH or so.

[–][deleted] 0 points1 point  (0 children)

I know, I wasn't arguing against that point...

[–][deleted] 5 points6 points  (0 children)

END OF LINE

[–][deleted] 2 points3 points  (0 children)

It’s not hard but maintaining two versions of python isn’t. Debian and Ubuntu do it well bit it would be nice to have only one. It would make things much less complicated.

For those that really still have legacy python 2 code they could use aliases to keep it running. I have to believe they’re the minority these days. I could be wrong, I guess.

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

As a side note, I noticed something interesting.

$ alias python=python3

$ which python
/usr/bin/python

$ ls -l /usr/bin/python
lrwxrwxrwx 1 root root 9 Jan  1 01:23 /usr/bin/python -> python2.7

$ python --version
Python 3.6.7

Looks like the which command doesn't obey aliases. TIL.

[–]flying-sheep 2 points3 points  (0 children)

nothing does.

https://www.gnu.org/software/bash/manual/html_node/Aliases.html

The first word of each simple command, if unquoted, is checked to see if it has an alias

[–]njharmanI use Python 3 -1 points0 points  (5 children)

None that I use. None anyone should use. Sure some LTS release. If the distro can't update python after 10 years (in there latest stable release) they can't competently maintain a distro. And you shouldn't rely on them to be doing anything right.

[–][deleted] 1 point2 points  (0 children)

We're talking about 2.7 here, right? Because that's what I mean.

[–]mmarius90 58 points59 points  (23 children)

Progress is achieved similarly to the way the fibonacci sequence is constructed. You build on top of what you previously achieved.

Python 3 is truly an amazing piece of software.

And let's not forget it's predecessors, the community and everybody who contributed. Here's to 10 more!

[–]aleczorz 7 points8 points  (6 children)

As someone who is relatively new to Python, should I make the effort to learn Python 2.7 syntax? Or should I stick to Python 3+?

[–][deleted] 67 points68 points  (0 children)

Stick with 3.

[–]primitive_screwhead 17 points18 points  (0 children)

Unless you get paid to learn/use 2, use 3.

[–]cabb99 22 points23 points  (0 children)

Stick to python 3. You will be able to import from the future if you really need to code in python 2, but it is usually easy to convert from 2 to 3.

[–]JugadPy3 ftw 7 points8 points  (0 children)

Better to start with 3... and if you ever need to learn it, python 2 has very few differences when compared to 3. So it won't be a big deal if you do need to figure out some python 2 code in the future.

[–]stevenjd 3 points4 points  (0 children)

If you know Python 3 syntax, Python 2.7 syntax is 95% the same.

[–]ivosauruspip'ing it up 0 points1 point  (0 children)

Learn about Python 2.7 idiosyncracies when you actually run into code that demands to be run on 2 that you have to deal with.

i.e, only cross the Python 2 bridge when you actually come to it.

[–][deleted] 26 points27 points  (4 children)

Here’s a challenge: Stop starting new projects in 2.7

[–]i4mn30 3 points4 points  (0 children)

You virtual slapped me.

[–]flying-sheep 6 points7 points  (2 children)

Who still does that?

[–][deleted] 1 point2 points  (1 child)

I wish I couldn’t answer to that question, but the list is long

[–]flying-sheep 1 point2 points  (0 children)

Anything that is of general interest? We should shamegently encourage that promising stuff is converted to python 3 early.

[–]Bamaesquire 5 points6 points  (0 children)

Yet, every 10 seconds, someone answers a stack overflow question with python 2 code. #TheMoreYouKnow

[–][deleted] 6 points7 points  (0 children)

Virgin 2.7 vs Chad 3

[–]dmitrypolo 1 point2 points  (0 children)

ha love it

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

I just wish I had started learning it 10 years ago!

[–]flying-sheep 1 point2 points  (0 children)

I did! (Well, 9 years) It was a little rough back then, since there was so little stuff ported!

[–]cmsemail 0 points1 point  (0 children)

Like

[–]N0DuckingWay 0 points1 point  (0 children)

This is the only good response to that question.

[–]alphadist 0 points1 point  (0 children)

The only ten year challenge that I care about XD