Hacker News new | ask | show | jobs
by borplk 4445 days ago
Damn. I hope my grandchildren see the day when Python 3 is commonplace.
2 comments

Guido's or yours opinions are irrelevant. If people have a lot of code for Python 2.7 and have little incentive to migrate to Python 3, then they'll stick with Python 2.7.
It's just prolonging the inevitable. Discontinuing support for python 2.7 may give people the spark they need to finally suck it up and migrate their code. But hey, if it's supported another 5 years, why bother.
If people have real compatibility problem to migrate to Python 3, harsh policies will do nothing about that. If I'm forced to rewrite my app I may as well rewrite it in Ruby, Go, Java, or whatever. Especially, if Python developers will prove to be aggressive about compatibility. Why would I migrate to Python 3, just to be forced to rewrite everything in Python 4 next time?
Well, you can sort of assume that they learned their lesson.

There also isn't really anything as drastic as the bytes/strings/Unicodes left to change.

(But these are better answers to worries about Python3 than they are answers to porting 2.x code bases)

I've used 2.* for about 10 years, quite happily.

If I switch to anything, I'll probably switch to Go.

(I originally typed 2.7, which is nonsense.)

that's quite an achievement, considering it was only released 4 years ago!
Well, the 2.x branch has been rather gracefully backwards compatible for many years. Even the jump from 1.x to 2.x was largely "assisted".

Personally, for me switching to 3 is a massive hindrance and probably I'll never do it. For the kind of things I use Python, the changes are extremely significant and it actually seems to me like a step backwards. It may be an improvement in other respects, though. I don't know.

> If I switch to anything, I'll probably switch to Go.

I think this is what is often happening, given that Go is attracting more Perl/Python/Ruby types than its original target audience of C/C++ developers.

Rewriting your code base is easier then fixing it for 3? That really just sounds like you are being overly dramatic, or looking for an excuse to try something new.
This is the same logic that got us stuck with IE6 and Windows XP for over 13 years (and we'll probably be stuck with it for a few more, altough IE6 has been dying now for a little while and Windows XP is being migrated off from)
See, when they invented new web browsers, the old websites still worked on them!

...and therein lies the difference.

> See, when they invented new web browsers, the old websites still worked on them!

Yeah. But only because they rendered the old websites in various quirks modes[1] that emulated the rendering engines of the old web browsers.

Thankfully, web browser developers did not share the analagous mindset to the people saying 'lets stick with python2-compatible semantics forever', or we'd still be writing sites that had to be backwards-compatible with IE6, instead of having the option to specify a modern doctype and use IE6-incompatible markup (the analogy to using a python3 shebang line and writing python2-incompatible code).

[1] https://en.wikipedia.org/wiki/Quirks_mode

Whatever. You're splitting hairs.

The sites worked. Quirks mode is now being phased out, but it served its purpose. The analogy Im making is obvious:

Python 3 should have run python 2 code and slowly rolled old semantics into depreciation; this whole mess could never have existed.

Its not as simple as 'just port your code and run python3'

Er, not all of them, that's why the old browsers were still used.
Don't understand; Python 2.x support is already there, how much work is it to NOT delete it? Its a whole different issue - IE6 was a burden on servers with progressive web design. This Python situation is the reverse (obverse? inverse?)
Since it's only bug & security fixes for Python 2.7.x from this point on, the momentum to python 3.x will pick up considerably.

Python 3 compatibility far outnumbers incompatible packages now: http://python3wos.appspot.com

The number of compatible packages is irrelevant. All it takes is one critical package to be stuck on 2.7.

It's not like I can just decide to drop the dependency on boto and twisted from all my work code and migrate to something else.

I understand that these are opensource projects and I should be submitting patches to make the migration faster, but from a business point of view, I have absolutely nothing to gain by doing that instead of just sticking with 2.7.

You are correct, but the number of blockers is getting smaller. I sympathize with your situation, boto is a pretty big blocker (PIL was too until I switched to Pillow) and it impacts several of my projects, but thankfully I can work on porting my code to 3.x with six https://pypi.python.org/pypi/six and still deploy on 2.7 until boto gets there.

and Twisted seems to be making good progress:

http://twistedmatrix.com/trac/milestone/Python-3.x

The disaster that is unicode in Python 2.7.x is enough for me to use Python 3 for anything I do in the future. And as you said there are enough compatible packages now to make this doable so yay for Python 3, and I say that as a former Python 3 skeptic.
A bit off topic, but what exactly makes boto so hard to port to Python 3? Whenever I look at this page I am puzzled by it still not supporting Python 3
There is a port in the works [0], and apparently they decided to go with a rewrite instead of just a port. I'm not sure of the exact reasoning, but that could explain why it takes them time.

[0] https://github.com/boto/boto3

There has certainly not been a lack of work on porting, there was the neo branch as well, there is some interesting (for some values of interesting) discussion about the approaches to 2.x and 3.x compatibility:

https://github.com/boto/boto/issues/1127

and also the py3kport branch:

https://github.com/boto/boto/tree/py3kport/py3kport

I don't know all the backstory, but when I pip-installed awscli in a py3.4 virtualenv this week, it pulled in "botocore", among others. Everything seems to work fine, so at least botocore works on version 3. Since awscli is a very complete AWS interface, it may be just a matter of documentation or a very thin API layer before everything one needs in boto works fine on v3.
Paramiko didn't make a 3.x release until recently.

(That doesn't make it hard or anything, but it seems lots of projects that depend on it were waiting)

I thought 2.7 has always been the bugfix branch and no new features would be ported to the 2.x branch after 2.7 was released? Some things were backported from 3.x to 2.x but that was done with 2.6 and 2.7.
> the momentum to python 3.x will pick up considerably.

People won't leave Python 2.7 for Python 3.x, they'll go to other languages. Python has no right to its users.

bullshit. i have several large Django code bases to maintain and all of them could move to py3 if needed if it wasn't for boto. As soon as they are ready porting boto my next projects will all be py3.
Considering Py2.7, Py3 is actually an "other language". Why would all these people throw out their Python expertise?