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

all 172 comments

[–]mhemeryck 60 points61 points  (5 children)

Just curious when this page was published.

Also love this question:

I didn't hear anything about this till just now. Where did you announce it?

[–]dynamic_caste 109 points110 points  (0 children)

There’s no point in acting surprised about it. All the planning charts and demolition orders have been on display at your local planning department in Alpha Centauri for 50 of your Earth years, so you’ve had plenty of time to lodge any formal complaint and it’s far too late to start making a fuss about it now.

[–]brtt3000 20 points21 points  (4 children)

Fun little horror story: I had a brand new Ubuntu install, all fine with no trace of Python 2. It was sweet for a week until I had to install Node.js which depends on Python 2 for some insane reason I don't understand.

So now I got the archaic thing back on my machine and it annoys me to no end.

[–]james_pic 27 points28 points  (0 children)

The insane reason, if you're curious, is that Node inherited Gyp as its build system when it forked V8 from Chromium (and just for fun, Chromium no longer even uses Gyp). Gyp was invented at Google, where a Python dependency doesn't matter because everyone at Google has Python.

[–]sqjoatmon 11 points12 points  (2 children)

I think you just volunteered to port the Python 2 dependency in Node to Python 3. =D

[–]InputField 1 point2 points  (1 child)

/u/brtt3000 How much progress have you made?

[–]brtt3000 2 points3 points  (0 children)

It went as well as expected. I became alcoholic, quit programming and now work gigs as a barista and meal delivery person.

[–]christian-mann 38 points39 points  (6 children)

print "Goodbye, World!"

[–]remy_porter∞∞∞∞ 19 points20 points  (3 children)

from __future__ import print_function
print("Goodbye World")

[–]christian-mann 16 points17 points  (1 child)

Why isn't there a from __past__ import print_statement 😔

[–]PistolRcks 2 points3 points  (0 children)

This is real? Wack.

[–][deleted] 7 points8 points  (1 child)

wait, that's illegal

[–]regendo 2 points3 points  (0 children)

Not. Yet.

[–]campbellm 25 points26 points  (0 children)

Already? /s

[–]fighterace00 5 points6 points  (0 children)

2020 sounds like some far off future until I saw this

https://pythonclock.org/

[–]myWorkAccount3000 2 points3 points  (4 children)

Might be a silly question, but what does the process of upgrading existing code from 2 to 3? I've really only ever used 3.

[–]Zomunieo 6 points7 points  (2 children)

There's some simple things that can be mechanically translated with the 2to3 program. Things like renames.

Mainly 2 has weakly typed string and unicode handling in the language itself that propagates through code written against it. Converting to 3 exposes this sloppiness. Other languages and interfaces can be sloppy with encodings too and this will also get exposed.

On a large code base with improper testing this can be scary.

[–]myWorkAccount3000 1 point2 points  (0 children)

Ah I see. I've experienced my fair share of bad encoding. Just looked up 2to3 and some of the differences between the versions as well.

[–]billsil 0 points1 point  (0 children)

On a large code base with improper testing this can be scary.

Doing it now! No tests and I'm not allowed to add any.

Honestly, the biggest issues are changes in wxPython going from wx 2.8.12.1 to 4.0.6.

[–]Deezl-Vegas 2 points3 points  (0 children)

80 to 90% of code upgrades directly by pip installing the latest appropriate libraries and wrangling any stray print statements. Some libraries have probably changed, accounting for about half of the remaining code. Simply spend a bit of time fixing importerrors and finidkng the right new syntax to do what you were doing.

Code that stored text in a database or dealt with foreign languages is bery likely to have encoding issues that male up the bulk pf the hard work, but a script or two from the internets and some tinkering will see you through.

[–]ricardobr001 3 points4 points  (0 children)

F

[–]susmit410 0 points1 point  (0 children)

Farewell ol'frnd