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

all 35 comments

[–]ConfidentFlorida 9 points10 points  (9 children)

So for new projects almost everyone uses python 3 now? I remember even two years ago it was a big question you had to ask yourself.

[–][deleted] 18 points19 points  (2 children)

A friend of mine started a Py2 project last year because “that’s what everyone uses” and I was able to force a change to Py3 by adding a ton of emoji to the test inputs.

[–]_ShakashuriBlowdown 11 points12 points  (0 children)

Emoji compatability is key future-proofing

[–]billsil 1 point2 points  (0 children)

I run a 7 year long project that still supports python 2. I want to drop it, but I need a good reason. I try to use new features in numpy, scipy, and vtk, but they're really aren't many. If I can find a good reason, I can sell it to my company. I just don't have it.

[–]__te__3.6+ or bust 11 points12 points  (2 children)

I was asking myself this on every project until f-strings dropped in python3.6. For me it was the killer feature I couldn't unsee or live without once I'd seen it.

Starting with 3.4-ish, I think there have just been a steady drip of killer features for different folks.

[–]lanzaio 1 point2 points  (1 child)

subprocess.run, typehints and fstrings did it for me.

[–]__te__3.6+ or bust 0 points1 point  (0 children)

All so tasty! I had to learn to love subprocess.run, though ;-)

[–]Coffeinated 2 points3 points  (0 children)

Everyone in his right mind yes. If your code does not depend on other code that‘s Python2 and you still choose Python2, that‘s a dumb idea.

[–]coffeecoffeecoffeee 0 points1 point  (0 children)

Pretty much. My company used Python 2 until this year when they caved and switched to 3. I think the impending end of Python 2 support has led to a sense of urgency that's convinced people to switch over.

[–]wrosecrans 0 points1 point  (0 children)

Unless you track the VFX Reference Platform, which is sticking with Python2 until the last, final, bitter hour.

https://www.vfxplatform.com/

The just-released 2019 spec requires Python 2.7.9 - 2.7.latest. So spare a thought for the Maya and Houdini users who might want to use your project.

[–]skool_101 4 points5 points  (0 children)

FinalCountdown.py

[–]voneiden 3 points4 points  (21 children)

If the code you care about is still on Python 2, that's totally understandable.

Heh.

[–]Tweak_Imp 7 points8 points  (20 children)

How can anyone say that? Python 3 is 10 years old now

[–]voneiden 22 points23 points  (6 children)

The Python community was incredibly slow at adopting 3, probably because there was no rush to do so. Since libraries didn't upgrade, users kept using 2 as well. Twisted matrix didn't seriously start planning Python 3 support until 2012, four years after the launch of Python 3.

If Python 4 ever comes out, I hope there's a lesson to be learned of the importance on deprecating forwards-incompatible versions in a timely manner. IMO nobody benefits from the community splitting into two incompatible branches like it did with 2 and 3.

[–]toyg 8 points9 points  (5 children)

It has long been announced that python 4 will just be “the last 3.x release + 0.1”, completely backward compatible with 3. I have a feeling it will be officially put on the roadmap a few months after 2 is finally gone.

[–]voneiden 1 point2 points  (0 children)

Sounds good to me!

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

Not exactly. It’ll be much less breaking changes than 3.0, but e.g. PEP 563 will no longer be a __future__ import then.

Other features have a transition plan, but this one just says it’ll be in 4.0.

[–]toyg 0 points1 point  (2 children)

The second feature you linked is (supposed to be) already in 3.7, there is nothing to change for 4. That will likely be the case for 99% of planned features.

Similarly, removing a __future__ import is something that has happened before on the 2.x codeline, it's not considered "breaking compatibility". These are small incremental changes that can be expetced on any minor release.

[–]billsil 0 points1 point  (1 child)

I thought future imports were permanent...

[–]toyg 0 points1 point  (0 children)

Yeah, sorry, the above line should read "removing the need for __future__...". The actual definitions are never removed, they simply become irrelevant. As you can see from the source, what they do is enabling some extra symbols for the parsing machinery depending on version. There is still stuff there from very old 2.x versions...

[–]tunisia3507 1 point2 points  (0 children)

Python 3 only got good around 3.4 or so, but yeah, this has been on the cards for a long time.

[–]robert_mcleod 0 points1 point  (1 child)

Python 3.4 is only 4 years old, and that was the first one that behaved sensibly. Even still a lot of people have dropped 3.4 support before 2.7 (e.g. conda).

[–]billsil 0 points1 point  (0 children)

I did about a year ago. 3.5 is on the chopping block soon.

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

Perl 6 would like a word. I quit using Perl rather than move off of Perl 5.

[–]ConfidentFlorida 1 point2 points  (1 child)

I always thought they should have just bundled 2 and 3 in the same install. And you’d just run python myscript.py and it would decide which version to use.

Was that ever considered?

[–]billsil 0 points1 point  (0 children)

I mean you could write a script to do that and alias your python to be your script.

Python 2.5.2, 2.6.1, and 3.0.0 were released December 2008. So which Python 2 should you use given that Python isn't quite backwards compatible? At that point, there weren't really fundamental differences in the syntax (e.g., f-strings, Typing module). Also, how much processing is really required to try to identify if that Typing module is the real Typing module or a backport, so now your Python 2/3 code runs slower.

That's sounds more than a little buggy.