I've done a lot of Python for many years and its all been Python 2. Python 3 seems to be a decent improvement, and if I was working on a Python 3 project, that would be fine. But when it comes to <i>new</i> projects, I struggle to find a compelling reason to use Python at all, when there are so many amazing languages now to choose from. With a new project you could choose Scala, Haskell, Clojure, Erlang (or Elixir) or Go. And there's also the less popular ones like Haxe and Dart. I've even been playing around with Elm. And I'm sure I've missed a bunch of others too.<p>So the question for me, for <i>new</i> projects is: why choose Python 3 (over all the other non python options) at all? Not what's better about Python 3 than Python 2, but what's better about Python 3 than those other choices. These other choices all have certain areas where they have great strengths. What is Python 3's strength when compared to these other languages? It's a mutable, imperative, single CPU bound language that can't target the browser and is extremely difficult to distribute and deploy. Or have these issues been fixed?<p>I don't mean to troll any Python fanboys. I use Python 2 every single day at work and I'm very happy with it. But what does Python 3 offer that other new languages don't? Because when you are starting a new project you can choose <i>anything</i>. Why should I choose Python 3 for my new projects?
Since everyone gives anecdotal proofs that Python 3 is just fine, I'll give mine as well. I've migrated to Python3 a rather big project (for the unicode handling) and although it was not quite easy, it'just fine now. I'm active in Qt, web, json, sql domains and I've never needed a library that is Python 2 only. Thus from my own point of view, the Python 3 ecosystem is just complete now. Super.
I tried switching to 3 a few years ago and was burned by some libraries that didn't work or worked with bugs.<p>Last year though I tried again and there were absolutely no problems. It's more natural, all non-dead libraries seem to support it, and in any case I was already using "from future import" for a while.<p>That said, I don't really intend to port old stuff from 2.7 if I can avoid it, so I expect that 2 and 3 will coexist for a while even within the same firm
The PyPi download statistics are constantly being quoted as though the are some exact representation of the state of Python 3 takeup.<p>I'm calling this as bullshit.<p>How much of these downloads are computers auto updating their configurations?<p>How, exactly, do these stats reflect the number of people developing current projects with Python 3?<p>The number of legacy projects written in Python 2 will be vastly higher than the number of Python3 projects currently in development. Maybe that's what is being updated.<p>When a statistician does an analysis of what these numbers really mean I will believe them but until then the numbers mean precisely nothing. Or more accurately, they seem to mean exactly what the Python 2 diehards want them to believe.<p>My assertion is that Python 3 is very actively and healthy and the PyPi stats are just lies, damn lies and statistics.
Python 3 is worth it not for asyncio and unicode (though these are very good reasons if you care about them). It's worth it due to 21st century exception handling, which breaks down in Python 2 in a spectacular fashion the moment you raise in your except: clauses.
I used to write a lot of personal Python scripts (ie ~/bin). I mainly did this because I seem to always screw up bash scripts and just can't remember all the conditional flags ie ([[-z ]] and error handling with bash for me has always been tricky.<p>However in the last couple of years I have dropped Python in favor of Groovy in part because I know the JVM and its plethora of libraries so well. Groovy is a highly underrated language. Really my only complaint is the startup time is not nearly as fast as Python but it does seem faster than say Clojure scripts. Also one of the things that I have to say I sort of think Java got right is that it has always been backward compatible (I know this was sort of impossible with Python given its not really a byte code language). That is I really don't have to worry if I write Groovy in a pre Java 5 (ie without generics) where as with Python I wasn't sure if I should write new scripts in 3 or 2.<p>The other annoying thing albeit far less than Ruby is dependencies with Python. Groovy has a complete bad ass way of just declaring dependencies in a script (@Grab) and they will automatically be downloaded. I have yet to see a scripting language that does this (ie dependency install on demand).<p>BTW since apparently any time I mention Java-like-tech on any HN post I seem to get downvoted... I really really love Python. This was not to denigrate Python or that Groovy is better than Python.
Python3 is still broken in some important ways (virtual environments) on Debian/Ubuntu, which make it a but of a pain to use both in development and production.<p>Example: Ubuntu 14.04 (and later versions) come with Python 3.4, but pyvenv is unavailable (just try searching ubuntu 14.04 pyvenv to get an idea).<p>This bug from 2014 is still relevant, although at least the "python3.4-venv" package is available to patch it enough to get going. <a href="https://bugs.launchpad.net/ubuntu/+source/python3.4/+bug/1290847?comments=all" rel="nofollow">https://bugs.launchpad.net/ubuntu/+source/python3.4/+bug/129...</a>
I don't understand the python2 vs python3 fuss. Maybe I'm not doing anything interesting enough, but I find it fairly easy to write code that runs in python >= 2.7 and python >= 3.3. If I was working in a python2-only code base, I would just baby-step it towards python3 compatibility. It doesn't have to be a complicated, disruptive task.
Unless it is explicitly necessary to use python 2 (like legacy stuff, that hasn't been upgraded yet), I've been using python 3 solely for almost 2 years, and there is no turning back. I have no reason to stick with the old version.<p>The last piece that needs to change, to complete the transition, is the majority of OS makers to bundle python3 by default.
We are using Python LDAP library[1] at work, but it is not available for Python 3 yet. Is there an alternative?<p>1 <a href="https://pypi.python.org/pypi/python-ldap/" rel="nofollow">https://pypi.python.org/pypi/python-ldap/</a>
I, for one, must admit to having almost completely ignored Python 3 until very recently. One thing I discovered that is way awesomer than you can imagine is Unicode handling: it just works! I'd say Unicode was a tricky issue in 50% of Python projects I've worked on in the past, but with Python 3, none of that matters anymore.
Been thinking about learning to code, and a lot of people have recommended Python as a good language to begin with. Taking a look at this, should I be looking elsewhere?
The problem is not Python 3, the problem is keeping both languages in my head at the same time. I'm tired of caring whether "print" is supposed to be a function or not, I just want to print something.
Three is (finally) likely to win, if only because of the constant nagging of the project leaders, and the fact that some distros will now move to it by default. But it will be a pyrrhic victory because it will have been a force-feed, not an enthusiastic, willing, adoption by the community. As a result of this mess, while Python's inertia is huge, its momentum is slowing. Its leadership, having lost credibility, cannot really lead effectively anymore.<p>It will continue to be a massive, unavoidable language, but something of the magic of when I first learned it, has been snuffed out.
I code in both 2 & 3, and had been nervous about that. New stuff with low dependencies in 3, and older stuff with Python C API dependencies in 2 (eg spreadserve.com). I was worried that the move to 3 would force migration of my 2 based code, so I'm reassured rather than alarmed by this article. The cognitive load switching between two Python dialects isn't as bad as, for instance, switching between C++ with and without STL & Boost.
On the web framework side of things, who is using aiohttp (web) and something like API-Hour? Seems like the performance is really great. Python 3 asyncio.<p>It's hard to find people blogging about it, not sure why? It seems like a great combination.<p><a href="http://blog.gmludo.eu/2015/02/macro-benchmark-with-django-flask-and-asyncio.html" rel="nofollow">http://blog.gmludo.eu/2015/02/macro-benchmark-with-django-fl...</a>
I've debated jumping from perl only dev into the python world for a couple of years now.<p>I've got a list of Django youtube vids queued up on my plex server right now. But I was thinking yesterday (while in the shower of course), perl has perl6 (which may or may not take off). But what does the future of python have?<p>Python 4,5,6? Any real innovative changes or just more of kicking the can down the road (such as perl5)?
I started off python learning python 3, but a few months into it, I was forced do a project in python 2. It was a turning point, I immediately ported over all my python projects to python 2. To me, it just seemed more simple, elegant, and cleaner. It was the more pythonic version of python. And if I'm still working with python after 2020, I'll be using python 2.
For anyone hesitant because they're worried they will need to support 2.x installations at some point, there is 3to2[1]. You can write for 3.5 only, and then back port only if you need to.<p>1. <a href="https://pypi.python.org/pypi/3to2/1.1.1" rel="nofollow">https://pypi.python.org/pypi/3to2/1.1.1</a>
My main gripe about Python 3 and Python in general is that it really needs a good method of distribution. Sure there's PyInstaller, but it's not straightforward enough and there's a lot of mystery problems that take a lot of time to figure out.
can we please stop writing articles in twitter?<p><a href="https://twitter.com/hynek/status/699928792752594944" rel="nofollow">https://twitter.com/hynek/status/699928792752594944</a>
This is the ultimate HN circlejerk comment<p>>Scala, Haskell, Clojure, Erlang (or Elixir) or Go. And there's also the less popular ones like Haxe and Dart<p>Are you kidding me? Did you just list the languages you see threads on HN about? Scala and Go I could maybe understand if you needed the performance but the rest of the choices are just bad. Especially if you are trying to start a business instead of a functional programming bootcamp.<p>Also there is nothing inherently more difficult about deploying and distributing python compared to any of the languages you chose.
Since it's basically all anecdotal, I'll say my gazing-into-the-crystal-ball educated-guess feeling that Python 4 will make the entirety of Python about as popular as Perl is today if: it doesn't get rid of GIL <i>and</i> at the same time implement a JIT compiler, <i>and</i> at the same time remain 100% .py source-code compatible with Python 3.<p>The developers have dug themselves into this mess with frivolous differences ("print" a function, wanting to remove the "%" string operator, etc.), instead of spending the years on more productive features, now is the chance to dig themselves out again.<p>It's a beautiful language, too bad the development choices were a bit sketchy.