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.

About Python 3

564 pointsby jnollerover 11 years ago

70 comments

agentultraover 11 years ago
I like Python 3. I prefer it. It is better to program in than 2.x. Iterators everywhere, no more unicode&#x2F;encoding vagueness, sub-generators and more. It is a much better language and it&#x27;s hard to see how it could have evolved without a clean break from its roots.<p>However it has been interesting to follow over the last five years. It has been a sort of, &quot;what if p5 broke the CPAN,&quot; scenario played out in real-life. Breaking compatibility with your greatest resource has a painful trade-off: users.<p>Everything I work on is not even considering a migration to Python 3. OpenStack? A tonne of Django applications that depend on Python 2-only libraries? A slew of automation, monitoring and system administration code that hasn&#x27;t been touched since it was written? Enterprise customers who run on CentOS in highly restrictive environments? A migration to Python 3 is unfathomable.<p>However my workstation&#x27;s primary Python is 3. All of my personal stuff is written in 3. I try to make everything I contribute to Python 3 compatible. I&#x27;ve been doing that for a long time. Still no hope that I will be working on Python 3 at my day job.<p>Sad state of affairs and a cautionary tale: &quot;Never break the CPAN.&quot;
评论 #6986521 未加载
评论 #6986378 未加载
评论 #6985697 未加载
评论 #6985774 未加载
thatthatisover 11 years ago
I&#x27;m going to go against the grain here and say that moving slowly is one of my absolute favorite features about python and its libraries.<p>Rails and django were released about the same time, rails is on version 4, django is on 1.6.<p>Moving slowly means I can spend more of my time writing code and less of my time upgrading old code. More importantly, every release requires a perusal: did the API change, what&#x27;s new, are there breaking changes I need to be aware of?<p>I didn&#x27;t appreciate how nice a slow but consistent and deliberate release cycle was until I started using Ember which seems to release a new version monthly.<p>Its generally acceptable to be one or two x.x versions back, but much more than that and the cost of maintaining libraries skyrockets, so you start losing bug fixes and library compatibility.<p>With python there&#x27;s not really a question of if I can run my code for a year between non-security upgrades, even with a few dozen third party libraries. That stability is immensely valuable.
评论 #6986855 未加载
评论 #6986684 未加载
评论 #6992197 未加载
评论 #6989521 未加载
评论 #6996533 未加载
themgtover 11 years ago
It&#x27;s fascinating to compare this with ruby 1.9, released around the same time, but seemingly with a slightly better cost&#x2F;benefit ratio, having nice new features and also significantly improved performance, and with ruby 1.8 being deprecated with a lot more speed and force. It got everyone to actually make the switch, and then ruby 2.0 came along, largely compatible and with a more improvements, and now ruby 2.1 seems to be an even smoother upgrade from 2.0.<p>The ability of the ruby core team to manage not just the technical aspect of making the language better, but smooth the transition in a way that actually succeeded in bringing the community (and even alternate ruby implementations) along with them, hasn&#x27;t been given nearly enough credit. You could analogize it to Apple with OS 9 -&gt; OS 10.9, versus Microsoft with people still running XP
评论 #6985674 未加载
评论 #6985616 未加载
评论 #6986152 未加载
GuiAover 11 years ago
Python 3 came from a good place, and it definitely fixes many problems that sorely needed fixing, but it was doomed to failure from the start (and many developers said that in 2008 already).<p>For all intents and purposes, Python 3 is pretty much a new, separate programming language. Sure, it&#x27;s very close to Python 2.x, but you don&#x27;t have out of the box retro-compatibility so that pretty much kills it right there.<p>Python 2.x is so huge in terms of its use around the world and available libraries and resources for it that you just can&#x27;t say &quot;hey, the new version of Python will in practice break everything&quot; and expect it to fly.<p>I love Python and the community around it (and have several packages on pypi myself), but Python 3 is a joke.<p>If we didn&#x27;t want to kid ourselves, we&#x27;d kill Python 3 and back port the interesting features, like Alex suggests. At this point though, too much effort and egos are involved to make this realistic.
评论 #6985451 未加载
评论 #6985406 未加载
评论 #6985460 未加载
evmarover 11 years ago
I like to think of engineering as &quot;solving problems within a system of constraints&quot;. In the physical world, engineering constraints are things like the amount of load a beam will bear. One of the primary easily-overlooked constraints in the software world is backwards compatibility or migration paths.<p>There are many examples of systems where many look at them today and say: &quot;This is terrible, I could design a better&#x2F;less-complicated system with the same functionality in a day&quot;. Some examples of this dear to my heart are HTML, OpenID, and SPDY. It&#x27;s important to recognize the reason these systems succeeded is they sacrificed features, good ideas, and sometimes even <i>making sense</i> to provide the most critical piece: compatibility with the existing world or a migration plan that works piecemeal. Because without such a story, even the most perfect jewel is difficult to adopt.<p>The OP, about Python 3, is right on except for when it claims making Python 3 parallel installable with 2 was a mistake; doing that would make it even more impossible to migrate to 3 (unless the single binary was able to execute Python 2 code). (Also related: how Arch screwed up Python 3 even more: <a href="https://groups.google.com/d/topic/arch-linux/qWr1HHkv83U/discussion" rel="nofollow">https:&#x2F;&#x2F;groups.google.com&#x2F;d&#x2F;topic&#x2F;arch-linux&#x2F;qWr1HHkv83U&#x2F;dis...</a> )
评论 #6985836 未加载
评论 #6987330 未加载
thezilchover 11 years ago
It wasn&#x27;t until 3.3 that py3 was really palatable. Easier to support unicode running the same codebase in py2 and py3. yield from -- look, a py3 feature worth porting for! 3.3 was released in late 2012, and so, we can probably shift this &quot;5 year&quot; expectation to start from there.<p>In fact, it&#x27;s 3.4 that really starts to wet the beak with asyncio and enum. I&#x27;m not sure 2.8 needs to happen, if 3.x simply, and finally, has good reasons to get on board.
评论 #6986091 未加载
cturnerover 11 years ago
Static platforms are great for developers. The best years of WebObjects&#x27; life were after Apple had mothballed it. Returning to a project years later - all the old code, scripts, and patterns worked just the same. Nothing else in the java world was like that. Similar story with BSD. The python 2&#x2F;3 migration has been well managed. There is no rush. Celebrate it.
评论 #6986211 未加载
评论 #6986415 未加载
falcolasover 11 years ago
As a development lead, we recently abandoned our plans to migrate to Python 3. Here&#x27;s a short summary of why:<p>To begin the migration, we needed to move from Python 2.6 (which is the default on our CentOS6 production boxes) to Python 2.7. This transition is actually rather hard. We can&#x27;t use the packages provided in CentOS base or EPEL, because they are all complied against Python 2.6. To re-produce all of our package requirements would require us to either build new packages of the compiled libraries (such as MySQL-python, python-crypto, PyYAML, etc), or load down our production environment with a compiler and all of the development libraries.<p>Migrating from Python 2.7 to Python 3 would have required a nearly identical effort (there&#x27;s not a lot of Python 3 packages for CentOS, in particular the packages that we need for our application).<p>Frankly, it&#x27;s just not worth that effort at this time. Python 2.6 is the default environment, there&#x27;s solid package support for it, and it just plain works. We&#x27;ll make that dive when Python 3 becomes the default for CentOS (scheduled for 8 or 9, IIRC), and probably not before.
评论 #6986162 未加载
评论 #6986171 未加载
评论 #6987926 未加载
评论 #6987187 未加载
评论 #6990873 未加载
评论 #6986798 未加载
评论 #6990704 未加载
saurikover 11 years ago
Reading the comments on Hacker News whenever someone brings up the issues with the Python 3 transition are horribly painful due to a systemic bias in that the people who care to read and talk about Python 3: they are mostly people who are in the 2% of people who apparently care enough to have upgraded already; everyone [edit: &quot;here who is saying&quot; was incorrect; &quot;here who normally says&quot; &lt;- today the discussion has been much more balanced, which is really nice] &quot;engh, its fine, I upgraded, I know tons of people who upgrade&quot; are ignoring the actual statistics cited by this developer [maybe having these actual numbers changed the discussion, pushing out the people who just insist nothing is going wrong?] that show &quot;no, you are wrong, you have a bunch of anecdotes because you know people like you and people like you actually wanted to upgrade for some extrinsic reason that your friends are more likely than the normal population to share with you&quot;. :(<p>If you cast a wider net, and talk to people at conferences that have nothing to do with fancy programming languages (and certainly not about Python itself), people aren&#x27;t using Python 3, and the feelings about Python 3 are mostly &quot;sarcastic bitterness&quot; (where like, you bring up Python 3 and they kind of laugh a little like &quot;yeah, no, obviously&quot;) surrounding the problem mentioned by this author that &quot;for the last few years, for the average developer Python, the language, has not gotten better&quot; while being told that upgrading is easy or somehow intrinsically valuable to them, which as this author points out comes across as the Python community just saying &quot;fuck you&quot; to their needs.
评论 #6987723 未加载
cool-RRover 11 years ago
I don&#x27;t share Alex&#x27;s concern. The migration to Python 3.X is a slow, but in my opinion sure process. Already many of my small internal programs run on Python 3.4, and I believe that in 1-2 years from now I&#x27;ll be writing most new Django client projects in Python 3.4 (hopefully running on Pypy3).
评论 #6986031 未加载
评论 #6986203 未加载
dvirskyover 11 years ago
The irony is that what&#x27;s keeping Python from moving forward is its own ecosystem.<p>PyPi makes it so easy to just add small libraries as dependencies to your project. This is part of what I like about it, but it comes with a cost - this exact problem.<p>I actually find the unicode thing a good enough reason to move to Py3, and porting my company&#x27;s own code is hardly and issue. But I just had a quick look at how much of our dependencies support Py3. No surprise - we can&#x27;t move. Not without porting a huge amount of code we don&#x27;t know by ourselves and hoping the pull requests get merged, or by dropping big dependencies from our code.<p>How big? Thrift, boto, MySQL-python, hiredis (the native C redis connection layer), fabric, mrjob - just to name a few. Some of these have big non compatible dependency trees themselves.<p>Neither of those are going to happen. So not having a big enough incentive is not my problem here. The price of migrating is simply too big compared to the incentives.<p>I think the only big enough incentive that would cause me to consider replacing or porting all this huge chunk of dependencies, is something indeed along the lines of GIL-less massive concurrency a-la Go.<p>But that doesn&#x27;t seem to be happening any time in the foreseeable future. Python 2.8 is a good idea for me as a user, but it will only persist the problem, not solve it. I don&#x27;t have any better idea other than Python should grow one huge carrot to create a tipping point, and enough pressure on library maintainers to hop on.
a3nover 11 years ago
Consider the new programmer, or the programmer new to python, or the corporation&#x2F;workgroup new to python whose focus is not at all python as python but just GSD.<p>They read this, or you show it to them: Should I use Python 2 or Python 3 for my development activity? <a href="https://wiki.python.org/moin/Python2orPython3" rel="nofollow">https:&#x2F;&#x2F;wiki.python.org&#x2F;moin&#x2F;Python2orPython3</a><p>It starts off very encouraging: &quot;Short version: Python 2.x is legacy, Python 3.x is the present and future of the language&quot;<p>Then we skim down to the meat of the page: Which version should I use?<p>Two short version stating that 3 is great, and you should use it. If you can.<p>And about 20 paragraphs of caveats.<p>To the person who&#x27;s been around the block once or twice, or doesn&#x27;t want to be seen as that pie in the sky programmer to his boss whose focus is not programming and doesn&#x27;t give a shit about new, what stands out is &quot;you can use virtually every resource available in 2, and almost mostly totally in 3 also.&quot;<p>And if you&#x27;re new in any sense, do you really want to spend the time researching <i>if</i> 3 is going to work for you or your group&#x2F;boss&#x2F;career? No, you pick 2 and GSD.<p>When that page is gone, or its caveats are substantially reversed, 3 will be the choice.
评论 #6989412 未加载
评论 #6994417 未加载
captainmuonover 11 years ago
Python fell into the Winamp trap. If anyone remembers, version 3 was pretty much crap, and many users stayed with 2.95 for ages. Now, I&#x27;m not saying Python 3 was bad, not at all, but the benefits don&#x27;t outweigh the cost of switching for many people.<p>Here&#x27;s my idea. Make a new &quot;Python 5&quot; (2+3=5, or call it whatever you want), based on Python 3. Put back everything that was deprecated or removed along the way, including the `print` statement. Provide `from python2 import xx` or `from python3 import xx` if there are incompatible module changes. To deal with the string changes, introduce an idiom like:<p><pre><code> bytes, str, unicode = python2_strings bytes, str, unicode = python3_strings </code></pre> or:<p><pre><code> from python2 import bytes, str, unicode from python3 import bytes, str, unicode </code></pre> which always maps &quot;bytes&quot; to the byte array (py2 &quot;str&quot;, py3 &quot;bytes&quot;), unicode to the unicode char array (py2 &quot;unicode&quot;, py3 &quot;str&quot;), and &quot;str&quot; to whatever the legacy code needs.<p>The goal would be to have 95% of legacy code run without modifications, or with a minimal addition of 2 lines to the top, or a command line switch.
评论 #6987139 未加载
hansjorgover 11 years ago
My last few Python projects have started out as Python 3, but ended up as 2 due to missing library support.<p>Would it be at all feasible to enable Python 3 to import Python 2 code? I imagine this could be done without making Python 3 fully backwards compatible, but I might be wrong.
评论 #6986520 未加载
justinphover 11 years ago
Something that might help is OS vendors shipping with 3.x installed, rather than 2.x most seem to.<p>OS X ships with 2.7.5. For a casual python user, sticking with what is there and working is safe, especially when the benefits of 3.x are unclear.
评论 #6985498 未加载
评论 #6985566 未加载
评论 #6985976 未加载
评论 #6986028 未加载
评论 #6985542 未加载
dekhnover 11 years ago
I used Python 3 for the first time a few days ago (I&#x27;ve been programming in Python for 18 years). When I used python heavily (I&#x27;ve switched back to C++ and now Go) I depended a lot on a small number of really good libraries- ElementTree, NumPy, SciPy, etc. Unless&#x2F;until all of those get ported to Python 3 (along with hundreds of other programs), and those ports are considered Correct (in the QA validation sense), it&#x27;s hard for me to consider wholesale conversion.<p>I did it because I was trying to parse Unicode in XML (Apple iTunes music files) and Python 2 is completely broken when it comes to unicode.<p>I consider Python 3 a big &quot;fuck you&quot; from Guido to the community. I don&#x27;t think he intended it to be so, but the effect of the long transition, and the lack of backported features in Python 2 (which could be easily accomodated), coupled with only limited adoption of Python3, demonstrate the leadership needs to pay closer attention to user pain.<p>Finally, I don&#x27;t think Python will ever address the simple and most important core issue: lacking good multithreading support will make the language continue to be more and more marginal. CPUs aren&#x27;t getting much faster, the CPython serial runtime isn&#x27;t getting any faster. Multiple cores on a single chip, and multiple threads in a core, are getting more numerous- and not being able to take advantage of them using the obvious, straightforward memory-sharing, multi-threaded techniques the chips are design to run well- is just a clear ignorance of the future of computing designs.<p>I switched back from Python to C++ when shared_ptr and unique_ptr, along with std::map and std::vector became standard enough that programming in C++ became easy: convenient memory management, and maps&#x2F;vectors are the two things that C++ adds to C that are valuable. Then I switched to Go because C++ compilation times are so bad, and writing high quality concurrent code is hard.
评论 #6985841 未加载
评论 #6986811 未加载
评论 #6985485 未加载
评论 #6985958 未加载
martinchoover 11 years ago
What is needed is a very high quality Python 2.x to 3.x migration or conversion tool to make library conversions trivial. If developers knew they could convert any 2.x code to 3.x code with no effort at all and with absolute certainty of proper operation they would probably migrate to the latest 3.x release en-masse.<p>How difficult would something like this be?<p>This might be really naive on my part. I haven&#x27;t really taken the time to study the differences between 2 and 3. I have avoided 3.x out of entirely selfish reasons: I simply don&#x27;t have the clock cycles to run into roadblocks.<p>These days languages are only as valuable as the breath and quality of the libraries around them. The issue with 3.x is that it created fear of not having access to small and large libraries developers leverage every day to be able to focus on their problem and not the problem addressed by the library. In that regard it is easy to be inclined to criticize Python leadership for approaching the transition with what might be perceived as a lack of consideration and understanding of the factors that might hinder it.<p>EDIT:<p>Just learned about 2to3:<p><a href="http://docs.python.org/2/library/2to3.html" rel="nofollow">http:&#x2F;&#x2F;docs.python.org&#x2F;2&#x2F;library&#x2F;2to3.html</a><p>Not sure how good it is. A quick look at the page gave me the sense that it might be somewhat involved. A true converter would be something that is as easy to use as the the import statement. Something like:<p><pre><code> import2to3 &lt;some_module&gt;, &lt;some_destination_directory&gt; </code></pre> It should not require any more thought than that and it should be 100% reliable.
评论 #6988323 未加载
评论 #6986612 未加载
DonGateleyover 11 years ago
Backwards ecosystem compatibility is a law of nature, not an option. Guido blithely broke a law of nature and the consequences, which should have been completely obvious to him, are just as anyone with history in the industry could have predicted (and most did.)<p>I&#x27;m at the decision point of which one to learn for a long languishing project I want to use it for. If I could write in 3.x and use the 2.x library ecosystem there would be no glitch whatsoever in my decision process. 3.x seems sufficiently advantageous _as a language_ to make the choice easy. As is, however, since I do not yet know what within the 2.x ecosystem will prove to be important or essential, my only intelligent choice is to maximize my options and go with 2.x. The advantages of the 3.x language don&#x27;t even begin to outweigh the potential disadvantages of coming up short.<p>I consider this irrevocable break with backward ecosystem compatibility (given the magnitude of the ecosystem) to be the worst, most egotistical decision I&#x27;ve ever seen in the computer field. Almost a death wish.
anilshanbhagover 11 years ago
Python3 is not exciting because well there is nothing to be excited about.<p>Consider me an average programmer, I have been using python for a year+ now. Most of the everyday stuff can be done in 2.7, some functionality I need &#x2F; can&#x27;t do I google and get a solution which works in 2.7. Why Py3 is not adopted is because there is not much benefit you get for doing the extra work (think chemistry - activation energy)<p>On another note, why can&#x27;t we port it the little goodness back to 2.7 ?
评论 #6986207 未加载
评论 #6986449 未加载
tristanperryover 11 years ago
I&#x27;m looking to learn Python, so it&#x27;s a pitty that there&#x27;s a schism of sorts within Python.<p>This sort of reminds me about PHP 6: a project with initially high momentum and various ideas to clean up the language. But over time it became clear that upgrading from the land of magic quote and register globals (PHP 4) to PHP 6 would have been too much of a jump.<p>So instead they slowly started deprecating and making improvements within the PHP 5 stream, and bit-by-bit PHP has moved on.<p>The change from Python 2 to 3 doesn&#x27;t look dramatic, but I can understand why there&#x27;s an air of lethargy regarding the upgrade.
ak217over 11 years ago
I feel frustrated too, but I think Ubuntu 14.04 will tip the scales (it ships with Python 3 by default).<p>Also, the core devs got at least some things right with Python 3.3 by making it a lot easier to write code that targets 2.7 and 3.3 at the same time. In retrospect, that should have been the focus much sooner.
评论 #6985746 未加载
PaulHouleover 11 years ago
The funny thing is I was getting downvoted by the peanut gallery on proggit and other sites when I was pointing out, years ago, that there is no such thing as &quot;Python&quot;, but really &quot;Python 2&quot; and &quot;Python 3&quot;.<p>It&#x27;s nice to see that pythonistas are starting to accept what an outsider saw give years ago.<p>Frankly the problem is a culture of overpromising and underdelivering that is endemic to Python. The situation with threading in PHP and Python is really the same: &quot;it almost works&quot; but the PHP community is responsible and says you shouldn&#x27;t really use threads and the Python community is irresponsible and says &quot;come in the water is fine&quot;.<p>The developers of languages such as PHP, C# and Java value backwards compatibility. Certainly things break from release to release, but some effort is made to minimize the effect, whereas in Python 3 they rewrote important APIs and broke a lot of stuff that they didn&#x27;t have to break.
评论 #6987282 未加载
antrodover 11 years ago
There is no meaningful performance increase to go to a backwards incompatible version? Three letters: DOA. if not performance then at least we&#x27;d need some crazy new feature like good multi threading or perhaps running on a new relevant platform (say ios or android). Otherwise we will be 2.X forever.
评论 #6985583 未加载
评论 #6985577 未加载
jrochkind1over 11 years ago
Meanwhile, in Railslandia, the annoyance is how much time you have to spend updating your old apps that rely on ruby versions or other dependencies that are no longer supported.<p>I&#x27;m annoyed that it&#x27;s looking like ruby 1.9.3 will be end-of-lifed sometime this spring, and I&#x27;m going to have to go and deal with updating a bunch of apps to ruby 2.0 or 2.1; it seems like it was just yesterday I had to spend way too much annoying time updating them all to 1.9.3 in the first place when 1.8.7 was EOL&#x27;d.<p>And don&#x27;t get me wrong, 1.9.3 is _so_ much better than 1.8; and the update to 2.x will hopefully be not so bad, but it&#x27;s still time I&#x27;m spending on the treadmill instead of new features.<p>Is there any path between the continual forced march of updates of ruby, and the lack of urgency so nobody ever upgrades of python?
JesseAldridgeover 11 years ago
Funnily enough, these days I&#x27;m spending most of my time writing Javascript. So that&#x27;s like two steps back. But that&#x27;s ok, because the language is not the bottleneck in software development. The big time sinks are learning new concepts and managing inherent logical complexity.
mixmastamykover 11 years ago
I was downvoted before for remarking that Py 3 needed a killer feature or two to drive adoption, similar to this post. Perhaps I was not charitable enough.<p>I&#x27;d personally like to see pypy bundled and a complete package manager solution, as well as usability features like bpython. I don&#x27;t think it is necessary to dump it. It just needs a little excitement.<p>Still, after many years I am finally planning to move my stuff to Py 3.4 when it comes out next year. No particular reason, it just feels like it is time. Shame that it doesn&#x27;t look like it will get into 14.04.
daemonkover 11 years ago
Rename it as something else. Call it Cobra or something. Also remove all backward compatibility features. Maybe by taking away it&#x27;s association with python, it will have a better chance.
评论 #6988088 未加载
评论 #6986157 未加载
erikbover 11 years ago
I think it&#x27;s just starting to roll. Only a month ago I argued in my company&#x27;s mailing list, that now is the time to finally start moving to Py3. Py3 is more stable now, most of the big libraries have finally moved. In a commercial set up it is just stupid to move forward, when the ecosystem hasn&#x27;t. But now it has, so now we start. I think people should just continue to improve in that direction. Maybe it will take 10 years, not 5. But it&#x27;s definitely going in the direction of Py3.
Rauchgover 11 years ago
I think a really good explanation of why people are not switching was provided by Ted Dziuba: <a href="http://teddziuba.com/post/26426290981/python-3s-marketing-problem" rel="nofollow">http:&#x2F;&#x2F;teddziuba.com&#x2F;post&#x2F;26426290981&#x2F;python-3s-marketing-pr...</a>
hyperpapeover 11 years ago
This seems like a reasonable perspective, but I wonder how much will change when Python 3 starts shipping with Linux distributions (and probably OS X eventually).<p>It won&#x27;t change anything for the shop that has a million LOC, but it might start to budge that 2% number.
评论 #6985557 未加载
评论 #6987742 未加载
mangelettiover 11 years ago
Ironically, I just started my <i>first ever</i> (Django) web app that is built for Python 3 only. I learned Python right after the release of Python 3, and so i learned everything with Python 3 in mind. For instance, I don&#x27;t think I&#x27;ve ever used print as a statement. I even used string.format for heaven&#x27;s sake, until I learned that there was little chance of the interpolation syntax going away.<p>Annnnyway... I am JUST not writing my first Python 3 application, and I have just installed (on OS X) Python 3 for the first time since 2009 (only as an experiment at that point).<p>Create a virtualenv and tell it to use Python 3 via `-p &#x2F;path&#x2F;to&#x2F;python3`, update your .gitignore to include __pycache__ directories, don&#x27;t write any code that uses features or syntax that was removed in Python 3 (since they added u&#x27;&#x27; support to Python 3, most devs I know are already doing this part), and you&#x27;re literally off to the races. My app&#x27;s requirements.txt has django==1.6.1, pytz==2013.8, South==0.8.4, django-debug-toolbar==1.0 (just released, btw), and ipython (obviously just for shell support). It works perfectly, and of course mock is included in Python 3, so you don&#x27;t need that anymore. There was one caveat though :( Fabric doesn&#x27;t work, because Parimiko is too deep a web to quickly update to run on Python 3.<p>tl;dr<p>I think Alex wrote this article too late. I think with Django finally having a release that fully supports (not experimentally like version 1.5) Python 3, a lot of libs supporting Python 3, and a lot of updates to Python 3 in the past year or so, we&#x27;ll probably see quite a few new apps being built for Python 3 in the next year.
评论 #6986572 未加载
gizbotover 11 years ago
The arrogance burns. It burns.<p>Python 3.0 was derailed by arrogance that developers <i>should</i> commit to a one-way transition that would touch every function rather than accept that, in Python 3.0, &#x27;x = u&quot;Hello&quot;&#x27; should have been a valid statement. It didn&#x27;t help that it ran slower, added nothing, and broke tools.<p>Python 3.3 was the first release that had a prayer, but there are mistakes everywhere. For example, virtualenv was included but broke because pip was not. Libraries like ftfy are required because the encodings break. Explaining the oddities of scoping inside generator expressions creates tricky interview questions. And then, Python 3 didn&#x27;t fix all the broken.<p>By broken, I mean actually broken. We know where its broken: lots of standard libraries like collections.namedtuple which has an argument to print a generated class. Strange cruft like calendar.weekheader() that only helps one developer&#x27;s program. This code is in the standard library. Handy things like cleaning up Unicode, DSL support, local encodings, security restrictions. Those you add from other libraries.<p>Also, where&#x27;s the love? The courage? I would love to see Python seriously consider dropping case and underscore sensitivity in order to speed up developers, an_item = anItem +1 would be a warning. I would like to see language translation support in the language, great packaging that just works, incorporation unit tests into the package system, reforming the dunder mess, anything! Instead I see the mediocrity by arrogance.<p>Just for fun, they moved the US Pycon conference to Canada. Only little people have troubles with international travel. Arrogance.
评论 #6994407 未加载
doe88over 11 years ago
For all its goodness I think it was a mistake to make syntax changes and other non-backward compatible changes in Python 3.<p>My current projects are currently compatible with Python 3 and it&#x27;s my main target whenever possible (depending on the dependancies).<p>But all in all this is one of these little things that make developping in Python less fun than before. This is not my preferred language anymore.
mkolodnyover 11 years ago
I&#x27;d love to use Python 3, but missing library support is definitely the killer for me. There&#x27;s a list of py3-compatible&#x2F;incompatible libraries here: <a href="http://python3wos.appspot.com/" rel="nofollow">http:&#x2F;&#x2F;python3wos.appspot.com&#x2F;</a>.<p>If we can pick off a few of those top py3-incompatible libraries, I&#x27;d be willing to bet that a shift to py3 would follow. Many of the libraries have long-standing py3 port branches if you&#x27;d like to help the effort. For example: <a href="https://github.com/boto/boto/tree/py3kport/py3kport" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;boto&#x2F;boto&#x2F;tree&#x2F;py3kport&#x2F;py3kport</a>.<p>As far as I&#x27;m concerned, there&#x27;s really very little in the way of me using Python 3. But what is in the way matters. Starting a project without being able to use boto, fabric and gvent would be tough. I like the idea of being able to import Python 2 libraries until they&#x27;re finally ported over to Python 3 a lot.
cpksover 11 years ago
The Python community may take this as a wake-up call to realize Python 3 was Python&#x27;s Vista&#x2F;ME&#x2F;Windows 8, rolled up into one.<p>My proposal: Call it a development version, and ask the community to upgrade when Python 4 fixes GIL, adds support for GPGPU, multicore, adds semantics useful for going fast, true lambdas, tail recursion, and adds all sorts of similar pretty things.<p>Forcing an upgrade down a community&#x27;s throat worked for Microsoft when they had a monopoly and could stop releasing security patches for older versions. And even then not well, and giving huge numbers of botnots.<p>Anything short of that is likely to fail and just hurt the size of the Python community. If I&#x27;m switching, there&#x27;s also Ruby and a few other places to go that aren&#x27;t Python 3.<p>I don&#x27;t like, want, or care about Python 3. It&#x27;s a regression for me. It&#x27;s not a popular view, so I&#x27;m not vocal about it, but I don&#x27;t think I&#x27;m in the minority here.
hnriotover 11 years ago
Python 3 is a huge distraction. It&#x27;s hard to get people to move away from languages like java while there&#x27;s a fragmented python world. If only we could just forget py3 the python community would be a better, more newbie friendly place. Every time I hire someone I have to explain why python 2 and why not &quot;the latest&quot;
dec0dedab0deover 11 years ago
This is kind of silly, but the main thing keeping me on Python 2 is the print statement.
评论 #6986115 未加载
sergiotapiaover 11 years ago
Wow, can&#x27;t believe it&#x27;s been this long and this is _still_ an issue.
koshakover 11 years ago
about python 3:<p><pre><code> $ python Python 3.3.3 (default, Nov 26 2013, 13:33:18) [GCC 4.8.2] on linux Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information. &gt;&gt;&gt; import timeit &gt;&gt;&gt; timeit.repeat(&#x27;for i in range(100): i**2&#x27;, repeat=3, number=100000) [4.451958370991633, 4.446133581004688, 4.4439384159923065] &gt;&gt;&gt; timeit.repeat(&#x27;for i in range(100): pow(i,2)&#x27;, repeat=3, number=100000) [5.343420933000743, 5.341413081012433, 5.3455389970040414] &gt;&gt;&gt; timeit.repeat(&#x27;for i in range(100): i*i&#x27;, repeat=3, number=100000) [0.8348780410015024, 0.8323301089985762, 0.8313860019989079] $ python2 Python 2.7.6 (default, Nov 26 2013, 12:52:49) [GCC 4.8.2] on linux2 Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information. &gt;&gt;&gt; import timeit &gt;&gt;&gt; timeit.repeat(&#x27;for i in range(100): i**2&#x27;, repeat=3, number=100000) [0.9710979461669922, 0.9630119800567627, 0.9619340896606445] &gt;&gt;&gt; timeit.repeat(&#x27;for i in range(100): pow(i,2)&#x27;, repeat=3, number=100000) [1.7429649829864502, 1.7306430339813232, 1.729590892791748] &gt;&gt;&gt; timeit.repeat(&#x27;for i in range(100): i*i&#x27;, repeat=3, number=100000) [0.6579899787902832, 0.6526930332183838, 0.6540830135345459] $ python -m timeit &#x27;&quot;-&quot;.join(str(n) for n in range(100))&#x27;; python -m timeit &#x27;&quot;-&quot;.join([str(n) for n in range(100)])&#x27;; python -m timeit &#x27;&quot;-&quot;.join(map(str, range(100)))&#x27; 10000 loops, best of 3: 49.4 usec per loop 10000 loops, best of 3: 40.6 usec per loop 10000 loops, best of 3: 32.8 usec per loop $ python2 -m timeit &#x27;&quot;-&quot;.join(str(n) for n in range(100))&#x27;; python2 -m timeit &#x27;&quot;-&quot;.join([str(n) for n in range(100)])&#x27;; python2 -m timeit &#x27;&quot;-&quot;.join(map(str, range(100)))&#x27; 10000 loops, best of 3: 30.2 usec per loop 10000 loops, best of 3: 25 usec per loop 10000 loops, best of 3: 19.4 usec per loop $ uname -rom 3.12.6-1-ARCH x86_64 GNU&#x2F;Linux</code></pre>
评论 #6990128 未加载
brownbatover 11 years ago
As a beginner, not a professional developer, python 3 always made more sense to me. Print is a function, 1&#x2F;2 is not 0.<p>I&#x27;ve heard the counterargument about backwards compatibility.[1] That hasn&#x27;t ever been just a 2 vs. 3 thing though. pyOpenSSL works with 32-bit 3.2, but dies with errors out of the box on Win-64 py 3.3. Last I checked, the PaiMei debugger works on 2.4, breaks on 2.7.<p>There are several projects that work with a specific deprecated subversion... it&#x27;d be weird if that were a common argument to keep everyone on 3.2, or 2.4 or something.<p>[1] <a href="http://help.codecademy.com/customer/portal/articles/887853-why-do-you-teach-python-2-7-3-" rel="nofollow">http:&#x2F;&#x2F;help.codecademy.com&#x2F;customer&#x2F;portal&#x2F;articles&#x2F;887853-w...</a>
PythonicAlphaover 11 years ago
I think, one mistake that was made with Python 3 is, that compatibility had initially very limited attention. They solved many problems of Python 2, but left the legacy behind ... and there was the trouble:<p>* Many libraries where limited to Python 2, because the effort converting them seamed to high<p>* Because of minor problems (like the infamous u&quot;-stuff), the overhead converting simple Python 2 programs was to high.<p>Some of the problems where fixed later (e.g. infamous u&quot;- is now legal in Python 3 and ignored -- why not before??), but I think that than it also was a little late ... Python 3 has evolved further and many people just got into the habit to ignore Python 3.<p>Not caring about compatibility can be necessary, but also can be a burden (that hurts a long time)!
malkiaover 11 years ago
Almost all Autodesk products come bundled with 2.x version of python. Could it be that Python 2.x is the Windows 7 of the Python world :) - just good enough for everyone.<p>(I&#x27;m not a python user, had to write few items for Maya&#x2F;MotionBuilder and few other scripts).
评论 #6988996 未加载
JulianWasTakenover 11 years ago
Not that this has ever been a showstopper whenever this comes up, but just to put some chips on the table, I personally have no interest generally in CPython development on 3.X, but I would pledge some help wherever I could in a potential 2.8 release.
wiremineover 11 years ago
Python 3 is a different language from Python 2. Yes, they are _almost_ the same language, but they are far enough apart to keep people from making the switch. It feels closer to Perl 5 =&gt; 6 vs. Ruby 1.x =&gt; Ruby 2.x.<p>That&#x27;s a gross over simplification, but it is closer to the truth than the Python 3 community likes to think.<p>I wonder: have there ever been a successful language rewrite, post critical pass, in the history of computer languages? If so, what lessons can be brought to the current Python 2&#x2F;3 situation?<p>For myself, as a professional Python programmer, I like Python 3 a lot. But until a critical mass of PyPi moves over, it isn&#x27;t worth the effort for most projects.<p>Edit: fixed a wrong word.
评论 #6986120 未加载
3pt14159over 11 years ago
If Guido had just left division the way it worked in 2.7 we&#x27;d all have moved by now. Everything else the community is fine with, but it is enough of a sticking point for some people that they can&#x27;t be bothered to make the switch.
评论 #6994834 未加载
ausjkeover 11 years ago
For web backend I feel the new PHP and its frameworks are good enough. JS&#x2F;HTML5&#x2F;CSS are doing well for web frontend at least, and they evolve fast. Java did well on Android and enterprise software stack. There are also Object-C, .NET for their market segments... Nothing can replace C&#x2F;C++ for system programming at this point. Additionally, many &#x27;minor&#x27; languages are here for different goals(Go, Erlang, etc).<p>Now the question, why do I need Python at all nowadays? I spent two years trying Python and ended up with PHP&#x2F;C&#x2F;C++&#x2F;JS&#x2F;Java for nearly all my needs.
cjdrakeover 11 years ago
I develop Python code that helps automate the design of Intel CPUs (&amp; graphics), and we recently (last week) upgraded to Python 3.3.3. Thankfully, I am less pessimistic than Alex on the subject.
RamiKover 11 years ago
Fix the GIL.<p>Python 3 isn&#x27;t getting used because it breaks backwards compatibility without offering many meaningful benefits. Sure, the syntax clean ups and the new sugar are nice and all. But you don&#x27;t rewrite a working code base because of &quot;nice&quot;.<p>So, fix the GIL; Replace the spaces indentations with tabs; Take out the stupid 79 line limit off PEP8; Even clean up the standard library... After all, if you don&#x27;t need to worry about backwards compatibility, then you might as well re-do it all properly.
评论 #6987585 未加载
jrochkind1over 11 years ago
I understand there are backwards incompatible changes in python 3.<p>But how hard is it to write code that works under both python 2 and python 3? Is this easy, or are the number and nature of changes so hard that this is a pain? How often do people write code that will work under both?<p>During the ruby 1.8 to 1.9 switch, it was common for people to write code that worked under both. How hard this was depended on the code base, but usually ranged from &#x27;very easy&#x27; to &#x27;medium but not that bad.&#x27;<p>You had to avoid the new features in 1.9.3 of course; you had to avoid a few features in 1.8.7 that had changed in backwards-incompat ways; and, mostly only around char encoding issues, you had to sometimes put in conditional code that would only run in 1.9.3. That last one was the most painful one, and overall it was sometimes a pain, but usually quite do-able, and many people did it.<p>Now, the ruby 1.8 to 1.9 migration was quite painful in many ways, but the fact that so many dependencies worked for a period in both 1.8 and 1.9, without requiring the developers to maintain two entirely separate codebases... is part of what made it do-able.<p>And, later, dependencies eventually dropping 1.8 support, of course, is part of what forced those downstream to go to 1.9.3. But by the time this happened, all of your major dependencies were probably available for 1.9.3, you rarely ran into the problem of &quot;one dependency is only 1.8.7 but another is only 1.9.3&quot;, because of that period of many developers releasing gems that worked under both.
评论 #6986967 未加载
pixelmonkeyover 11 years ago
Is there a tool that will take a requirements.txt file and let you know whether all the packages in that file are already Python 3 compatible (by looking up corresponding packages on PyPI)?<p>If not, that tool seems worth writing, and then we can do a poll of some major production codebases and see whether Python 3 support is actually missing.<p>As for &quot;Python 2.8&quot;: meh. I think we should just support the development of tulip &#x2F; asyncio in Python 3.4 (see docs, this is looking awesome already: <a href="http://docs.python.org/3.4/library/asyncio.html" rel="nofollow">http:&#x2F;&#x2F;docs.python.org&#x2F;3.4&#x2F;library&#x2F;asyncio.html</a>), then use our blog platforms as Pythonistas to promote all the new async programming you can do using asyncio + Futures + yield from, port over important async frameworks like Tornado&#x2F;Twisted, etc.<p>In that case, Python 3.4 becomes the Python release that gives you all the power &#x2F; convenience of Python 2.x with a complete cleanup of callback spaghetti code as demonstrated in the &quot;hello, world&quot; co-routine example: <a href="http://docs.python.org/3.4/library/asyncio-task.html#example-hello-world-coroutine" rel="nofollow">http:&#x2F;&#x2F;docs.python.org&#x2F;3.4&#x2F;library&#x2F;asyncio-task.html#example...</a> -- I think async programming is mainstream enough, especially in web&#x2F;mobile&#x2F;API applications, that this will be a compelling draw for people.<p>I think the only thing GvR and crew got wrong is the timing -- it probably won&#x27;t take 5 years from release for everyone to migrate to Python 3, but it will take more like 8-10. But it&#x27;ll happen.
iandanforthover 11 years ago
I&#x27;ll be honest. I&#x27;m waiting until Guido says it&#x27;s time.<p>The phrase that I have stored at the moment is &quot;Python 3 is the future of Python.&quot; Fine. Great. But that&#x27;s not good enough.<p>This page needs to be updated: <a href="https://wiki.python.org/moin/Python2orPython3" rel="nofollow">https:&#x2F;&#x2F;wiki.python.org&#x2F;moin&#x2F;Python2orPython3</a><p>It should be shortened to read, in its entirety, &quot;Python 3.&quot;
dorfsmayover 11 years ago
What is really needed is a 3to2.<p>I have been very impressed with 2to3, the amount of work it does is pretty impressive. But as somebody who tends and prefers to work in python 3 but often needs my scripts to run in python 2, I have no choice but write those in python 2. I can see the same dilemma for somebody who writes an open source library and hope for as much usage as possible.
评论 #6985473 未加载
评论 #6985479 未加载
评论 #6985689 未加载
jurassicover 11 years ago
From where I sit, it seems like the 2&#x2F;3 schism is the result of &quot;one and only one way to do something&quot;. While is sounds like a good slogan and I was on board with this party line for a long time, breaking perfectly good features in pursuit of a more perfect adherence to &quot;only one way&quot; does nothing except alienate the community.
knglover 11 years ago
Making python 2 a little bit more compatible with python 3 is not the way to go.<p>What about make python 3 fully retro-compatible with python 2.7 with the help of magic imports<p><pre><code> from __past__ import byte_strings from __past__ import except_tuple </code></pre> first this will output warnings, then it will raise RuntimeError.
paganelover 11 years ago
This feels a lot like the migration from Zope2 to Zope3, which everybody was saying was going to be painless and wonderful and then Django happened. As a long-time Python user (and a reluctant former Zope user) I hope things will not turn out the same this time round.
hyp0over 11 years ago
<p><pre><code> [Python 3 releases live in parallel to Python 2] In retrospect this was a mistake, it resulted in a complete lack of urgency for the community to move </code></pre> Adoption comes from solving urgent problems - not from creating them.
laurenyover 11 years ago
To make matters worse, I&#x27;m seeing an increasing number of Python programmers switch to Go and I predict that Go will slowly replace Python 2 over the next few years.
mburstover 11 years ago
As sad as it may sound, the most annoying thing about Python 3 for me is this:<p>print &quot;Hi&quot;<p>vs<p>print(&quot;hi&quot;)<p>Other than that, as Alex said there isn&#x27;t much difference between the two.
评论 #6990654 未加载
评论 #6989760 未加载
JacobIrwinover 11 years ago
I think you are speaking to a large audience with this post. All python devs are continuously aware of the ongoing avoidance of using newer version. It&#x27;s a problem that should be addressed even more directly with us all... what are the key transitional obstacles to overcome when upgrading from, say, 2.7 to 3.x? etc.<p>Thanks for shining some light on the issue.
busterover 11 years ago
Ok, so one thing:<p>Python3 is just now becoming the default for many Linux distributions. Once that adoption took place the adoption of Python3 will increase very much. It&#x27;s as simple as this. Once this milestone is hit, the remaning incompatbible libraries will see fixes for python3.
jemeshsuover 11 years ago
All major libraries&#x2F;frameworks please drop support for Python 2 by end 2014.
SimHackerover 11 years ago
This depressing problem requires a crazy solution. Rewrite Python 3 in JavaScript so it runs on V8, and can interoperate with JS code. ;)
hyp0over 11 years ago
Reminds me of Perl 6, which was designed not to meet a user need, but to keep the Perl developers engaged. It has succeeded in this.
wyuenhoover 11 years ago
PHP 4 and PHP 5 weren&#x27;t compatible either. How come migration was so much more successful over there than Python 2 to Python 3?
评论 #6985864 未加载
评论 #6986177 未加载
steven_yueover 11 years ago
I really can not think of a promising reason to switch from 2.X to 3<p>Sometimes I feel that Python will end at version 3
twstedover 11 years ago
A pypy-backed Python 4 (with all the features of 3.4) and everyone will jump.
paskakapuover 11 years ago
python3 destroyed it&#x27;s ability work as simple calculator. Try this on python3:<p>&gt;&gt;&gt; answer = 1 + 1 &gt;&gt;&gt; print answer
评论 #6992404 未加载
JSnoover 11 years ago
From the cases I saw(might be biased), a lot of new projects start to use Python3. These projects don&#x27;t need to consider backward compatibilities. Majority of people will use python 3 in python world. Regarding Ruby, it is more elegant and consistent.And also seems Mats has clearer idea where Ruby will go. so in a long run. Ruby will catch up python in my own opinion.
dschiptsovover 11 years ago
The problem is that Linux distros are still use 2.7.x as default interpreter. As soon as they complete migration to 3.3.x everything will improve, and maintainers of the packages would be pressed to cope with reality.<p>At least mod_python already aware of existence of python 3.3.x ,)
revskillover 11 years ago
I wonder why Django doesn&#x27;t have the same strength (both technically and community) as Rails ? I think the philosophy &quot;Everything is an object&quot; makes sense actually, and in combination with functional programming built-in really makes Ruby is perfect choice for non-professional programmer (even woman) to love coding.
评论 #6986247 未加载
评论 #6986138 未加载
评论 #6985781 未加载
评论 #6989767 未加载
评论 #6985900 未加载