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.
Python 2.x vs. 3.x use survey
51–60 of 72 posts
Re: Python 2.x vs. 3.x use survey
#52Re: Python 2.x vs. 3.x use survey
#53I 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…
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
#54I 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…
Re: Python 2.x vs. 3.x use survey
#55Let'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…
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
#56Earlier 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] >>>
That is indeed cleaner. Thanks for the explanation.
Re: Python 2.x vs. 3.x use survey
#57Re: Python 2.x vs. 3.x use survey
#58Earlier 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.
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
#59Still 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.