Live data from Hacker News

Python 2.x vs. 3.x use survey

docs.google.com

51–60 of 72 posts

Re: Python 2.x vs. 3.x use survey

#51

Meanwhile, the Python 3 Wall of Superpowers is looking really good. 166/200 major watched projects are Python 3-compatible. https://python3wos.appspot.com

Python 2 was supposed to be dead at least 2 years ago and still 34/200 major watched projects use it.

I don't know where you got this, but it was never planned to have been dead two years ago. 2.7.0 happened in July 2010, and regular bug and security fixing would still have been happening up until around this time regardless of anything else (fwiw, 2.6 went from 2008-2013). Instead, we decided earlier this year to extend that support until 2020.

Re: Python 2.x vs. 3.x use survey

#52
We use a lot of python stuff at work for automation, moving large video projects around, etc. And since on all the OSX machines python2 comes pre-installed, but there's no py3k, it's a lot easier just to stick with that. It also means the scripts work out of the box on Ubuntu, Debian and CentOS - although for some of our older CentOS installs I have to stick w/ 2.6, which is a bit of a pain.

Re: Python 2.x vs. 3.x use survey

#53

I write all of my side projects in Python 3.4. I only write 2.7 because I work on Openstack at my day job. I avoid the use of Python 2 in every situation I can. Python 3 has better modules built-in; the existing modules have been cleaned up; a cleaned up language (no more xrange, lazy map/filter/reduce, explicit byte-stream encoding); an improved language (sub-generators); optional type annotations; configurable allo…

> I write all of my side projects in Python 3.4. I only write 2.7 because I work on Openstack at my day job.

And that's the issue.You cant be a pro pythonist unless you know both,even if you prefer 3.x .Not saying 2.x is an entire different language.Still,Python devs have to know the differences between both versions.

Re: Python 2.x vs. 3.x use survey

#54

I write all of my side projects in Python 3.4. I only write 2.7 because I work on Openstack at my day job. I avoid the use of Python 2 in every situation I can. Python 3 has better modules built-in; the existing modules have been cleaned up; a cleaned up language (no more xrange, lazy map/filter/reduce, explicit byte-stream encoding); an improved language (sub-generators); optional type annotations; configurable allo…

Let's just be thankful for OpenStack dropping support of Python 2.6!

Re: Python 2.x vs. 3.x use survey

#55

Let's be honest. The fact that surveys like this are still around 6 long years later has just become boring. I have moved to Python 3 purely because of asyncio. There is no other reason that I have found Python 3 to be compelling for. When I write Python 3 now, I feel like my favourite language has gone all "serious" on me, like it wanted to grow up, and has lost a lot of its charisma on the way. I actually liked the…

I really miss the ease of the print statement and therefore was very happy to discover ipython's automatic parentheses - http://ipython.org/ipython-doc/dev/interactive/reference.htm...

Activating this option allows the parser to automatically infer function parentheses, just like in ruby. Though ruby still wins by virtue of its single letter `p` function.

Re: Python 2.x vs. 3.x use survey

#56

Earlier quoted context omitted.

As one of those crazy functional programmers who uses python, can you please explain to me what the benefit is in remove xrange, lazy map/filter/reduce, and other functional mainstays in exchange for what is essentially more syntax to do the same?

It's the other way around, they are not removed, the default implementations are now lazy. So in python 3 you get an interator: >>> map(lambda i:i*i, range(5)) and have to explicitly construct a list: >>> list(map(lambda i:i*i, range(5))) [0, 1, 4, 9, 16] >>>

Ah, I actually like that!

That is indeed cleaner. Thanks for the explanation.

Re: Python 2.x vs. 3.x use survey

#58

Earlier quoted context omitted.

It's the other way around, they are not removed, the default implementations are now lazy. So in python 3 you get an interator: >>> map(lambda i:i*i, range(5)) and have to explicitly construct a list: >>> list(map(lambda i:i*i, range(5))) [0, 1, 4, 9, 16] >>>

Ah, I actually like that! That is indeed cleaner. Thanks for the explanation.

Traversing a binary tree without an explicit stack is also much cleaner thanks to sub-generators.

    if tree.left:
        yield from traverse(tree.left)
    
    yield tree
    
    if tree.right:
        yield from traverse(tree.right)
As a trivial example.

Re: Python 2.x vs. 3.x use survey

#59

Still on 2.x, simply because it's a lot easier to use the generally available system packages than constantly rolling/building your own. 2.x is not missing anything I need, so there's simply little incentive to migrate my code to 3.x until the package support is there.

Genuinely curious - which packages are you missing in 3.x?
Post reply on HN