TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Python 3 in 2016

184 pointsby jaxonduover 9 years ago

28 comments

retrogradeorbitover 9 years ago
I&#x27;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&#x27;s also the less popular ones like Haxe and Dart. I&#x27;ve even been playing around with Elm. And I&#x27;m sure I&#x27;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&#x27;s better about Python 3 than Python 2, but what&#x27;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&#x27;s strength when compared to these other languages? It&#x27;s a mutable, imperative, single CPU bound language that can&#x27;t target the browser and is extremely difficult to distribute and deploy. Or have these issues been fixed?<p>I don&#x27;t mean to troll any Python fanboys. I use Python 2 every single day at work and I&#x27;m very happy with it. But what does Python 3 offer that other new languages don&#x27;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?
评论 #11125445 未加载
评论 #11124963 未加载
评论 #11124877 未加载
评论 #11125469 未加载
评论 #11125886 未加载
评论 #11125447 未加载
评论 #11124900 未加载
评论 #11125176 未加载
评论 #11124945 未加载
评论 #11125479 未加载
评论 #11124899 未加载
评论 #11128463 未加载
评论 #11124986 未加载
评论 #11124874 未加载
评论 #11125539 未加载
评论 #11125335 未加载
wiz21cover 9 years ago
Since everyone gives anecdotal proofs that Python 3 is just fine, I&#x27;ll give mine as well. I&#x27;ve migrated to Python3 a rather big project (for the unicode handling) and although it was not quite easy, it&#x27;just fine now. I&#x27;m active in Qt, web, json, sql domains and I&#x27;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.
评论 #11124809 未加载
评论 #11125664 未加载
zzleeperover 9 years ago
I tried switching to 3 a few years ago and was burned by some libraries that didn&#x27;t work or worked with bugs.<p>Last year though I tried again and there were absolutely no problems. It&#x27;s more natural, all non-dead libraries seem to support it, and in any case I was already using &quot;from future import&quot; for a while.<p>That said, I don&#x27;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
评论 #11124644 未加载
andrewstuartover 9 years ago
The PyPi download statistics are constantly being quoted as though the are some exact representation of the state of Python 3 takeup.<p>I&#x27;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&#x27;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.
评论 #11124630 未加载
评论 #11124605 未加载
评论 #11125515 未加载
baqover 9 years ago
Python 3 is worth it not for asyncio and unicode (though these are very good reasons if you care about them). It&#x27;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.
评论 #11124739 未加载
agentgtover 9 years ago
I used to write a lot of personal Python scripts (ie ~&#x2F;bin). I mainly did this because I seem to always screw up bash scripts and just can&#x27;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&#x27;t have to worry if I write Groovy in a pre Java 5 (ie without generics) where as with Python I wasn&#x27;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.
评论 #11130485 未加载
fideloperover 9 years ago
Python3 is still broken in some important ways (virtual environments) on Debian&#x2F;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 &quot;python3.4-venv&quot; package is available to patch it enough to get going. <a href="https:&#x2F;&#x2F;bugs.launchpad.net&#x2F;ubuntu&#x2F;+source&#x2F;python3.4&#x2F;+bug&#x2F;1290847?comments=all" rel="nofollow">https:&#x2F;&#x2F;bugs.launchpad.net&#x2F;ubuntu&#x2F;+source&#x2F;python3.4&#x2F;+bug&#x2F;129...</a>
jorge-fundidoover 9 years ago
I don&#x27;t understand the python2 vs python3 fuss. Maybe I&#x27;m not doing anything interesting enough, but I find it fairly easy to write code that runs in python &gt;= 2.7 and python &gt;= 3.3. If I was working in a python2-only code base, I would just baby-step it towards python3 compatibility. It doesn&#x27;t have to be a complicated, disruptive task.
评论 #11127398 未加载
dethosover 9 years ago
Unless it is explicitly necessary to use python 2 (like legacy stuff, that hasn&#x27;t been upgraded yet), I&#x27;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.
评论 #11127959 未加载
srathiover 9 years ago
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:&#x2F;&#x2F;pypi.python.org&#x2F;pypi&#x2F;python-ldap&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pypi.python.org&#x2F;pypi&#x2F;python-ldap&#x2F;</a>
评论 #11124789 未加载
评论 #11125012 未加载
评论 #11125052 未加载
paulhallettover 9 years ago
We&#x27;ve been using Python 3 since we implemented a new service architecture and it&#x27;s been an easy transition for our 50+ engineers.
czepover 9 years ago
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&#x27;d say Unicode was a tricky issue in 50% of Python projects I&#x27;ve worked on in the past, but with Python 3, none of that matters anymore.
glovesover 9 years ago
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?
评论 #11124723 未加载
评论 #11125125 未加载
评论 #11125428 未加载
Walkmanover 9 years ago
In practice: inheriting from &quot;object&quot; every time is not a big deal, but losing the possibility to use Pypy or Kivy is huge.
评论 #11126112 未加载
draw_downover 9 years ago
The problem is not Python 3, the problem is keeping both languages in my head at the same time. I&#x27;m tired of caring whether &quot;print&quot; is supposed to be a function or not, I just want to print something.
评论 #11125985 未加载
vegabookover 9 years ago
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&#x27;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.
评论 #11124869 未加载
osullivjover 9 years ago
I code in both 2 &amp; 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&#x27;m reassured rather than alarmed by this article. The cognitive load switching between two Python dialects isn&#x27;t as bad as, for instance, switching between C++ with and without STL &amp; Boost.
cdnsteveover 9 years ago
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&#x27;s hard to find people blogging about it, not sure why? It seems like a great combination.<p><a href="http:&#x2F;&#x2F;blog.gmludo.eu&#x2F;2015&#x2F;02&#x2F;macro-benchmark-with-django-flask-and-asyncio.html" rel="nofollow">http:&#x2F;&#x2F;blog.gmludo.eu&#x2F;2015&#x2F;02&#x2F;macro-benchmark-with-django-fl...</a>
esaymover 9 years ago
I&#x27;ve debated jumping from perl only dev into the python world for a couple of years now.<p>I&#x27;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)?
评论 #11127020 未加载
评论 #11127311 未加载
libeclipseover 9 years ago
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&#x27;m still working with python after 2020, I&#x27;ll be using python 2.
评论 #11125200 未加载
emmelaichover 9 years ago
It&#x27;s quite possible that someone will come up with a good enough automatic 2-&gt;3 converter which alleviate the situation.
评论 #11125071 未加载
评论 #11125237 未加载
评论 #11128519 未加载
评论 #11124954 未加载
mangelettiover 9 years ago
For anyone hesitant because they&#x27;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:&#x2F;&#x2F;pypi.python.org&#x2F;pypi&#x2F;3to2&#x2F;1.1.1" rel="nofollow">https:&#x2F;&#x2F;pypi.python.org&#x2F;pypi&#x2F;3to2&#x2F;1.1.1</a>
jdlygaover 9 years ago
My main gripe about Python 3 and Python in general is that it really needs a good method of distribution. Sure there&#x27;s PyInstaller, but it&#x27;s not straightforward enough and there&#x27;s a lot of mystery problems that take a lot of time to figure out.
amstockerover 9 years ago
I think this is a nice healthy view to have about Python 2 to 3. Can&#x27;t wait until python 4!
评论 #11124835 未加载
hathymover 9 years ago
can we please stop writing articles in twitter?<p><a href="https:&#x2F;&#x2F;twitter.com&#x2F;hynek&#x2F;status&#x2F;699928792752594944" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;hynek&#x2F;status&#x2F;699928792752594944</a>
angvpover 9 years ago
Not going to happen IMO, yet no advantages to do the transition.
评论 #11125674 未加载
moistgorillaover 9 years ago
This is the ultimate HN circlejerk comment<p>&gt;Scala, Haskell, Clojure, Erlang (or Elixir) or Go. And there&#x27;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.
评论 #11128413 未加载
评论 #11127276 未加载
ivorasover 9 years ago
Since it&#x27;s basically all anecdotal, I&#x27;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&#x27;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 (&quot;print&quot; a function, wanting to remove the &quot;%&quot; string operator, etc.), instead of spending the years on more productive features, now is the chance to dig themselves out again.<p>It&#x27;s a beautiful language, too bad the development choices were a bit sketchy.
评论 #11125450 未加载
评论 #11124849 未加载
评论 #11124826 未加载