Will Python 3 ever catch on?

后端 未结 5 410
再見小時候
再見小時候 2021-02-05 05:15

I have been learning a bit of Python 2 and Python 3 and it seems like Python 2 is overall better than Python 3. So that\'s where my question comes in. Are there any good reasons

相关标签:
5条回答
  • 2021-02-05 05:57

    More iterators (in things like dict.keys()) will be a big boost for web applications.

    The core team will put more work into the new version. New books might focus on python 3 (see Dive into Python), but the real work is still done in python 2.

    Sooner or later, the big libraries (numpy, wx, django) will be ported. Until those big three switch, I can't see many people using python 3. But those aren't impossible projects to port.

    Once the big libraries are ported, the community will face a real choice. That's when it will start to catch on.

    0 讨论(0)
  • 2021-02-05 06:06

    Python 3 is going to be the new standard going forward.

    As no major sweeping changes are planned to Python 3 anytime soon, more people will eventually be moving to it. So... although there are many Python 2 applications around now, eventually many of these applications will be migrated up. There is even at tool for this, 2to3.

    Also, what makes you say that python 2 is better than 3? There were many language improvements made in Python 3, and even IDLE is improved. One major reason to upgrade is that unladen-swallow is coming to python 3, which will vastly improve performance.

    0 讨论(0)
  • 2021-02-05 06:12

    On the whole, and even in most details, Python3 is better than Python2.

    The only area where Python 3 is lagging is with regards to 3rd party libraries.
    What makes Python great is not only its intrinsic characteristics as a language and its rather extensive standard library, but also the existence of a whole "eco-system" of libraries which support so many specific applications of the language.
    Several such libraries are, at the moment not fully ported to Python 3.x and this sometimes results in keeping people developing under Python 2.x.

    This situation may seem a bit like a chicken and egg problem: Application developers won't move to 3.x till the libraries "get there", libraries developers would rather only maintain one branch and are waiting in an attempt to time the porting to Py3k in a way that they can put the their Py2.x branches in maintenance shortly thereafter.

    This situation is somewhat of a testimony the satisfaction people have of Python 2.x (or phrased more negatively, to the lack of truly compelling incentives for a move to 3.x; while Py3k is better and poised for better things yet, as-is, it doesn't have any features that would prompt a move to 3.x "en masse".) This said, I believe the momentum is effectively in favor of Python 3.
    To back this up, I was about to mention the likelihood that Unladen Swallow be only ported to Py3k-only, providing some strong incentive for the move. But Alex Martelli has started answering this question, and is using this example. Obviously Alex speaks first-hand of these roadmap questions, please get it from the Master!

    A word of caution regarding Py3k versions: Be sure to use the most recent version (currently 3.1.2, soon 3.2.x will replace it as the most recent stable version).
    Beware that some folks (like me) occasionally use the expression "3.0" to reference the generic name for all Py3k (or even for the current version thereof). The short lived 3.0 version per-se is now "defunct" and of no interest but maybe forensic specialists ;-)

    0 讨论(0)
  • 2021-02-05 06:14

    As other answers mention, the only real (and crucial) current advantage of Python 2 over Python 3 is that the former already has a huge wealth of third-party extensions (and auxiliary tools, such as IDEs and the like), which the latter is only gradually moving towards. This is a situation that's gradually improving, as existing extensions are ported to support Python 3; sooner or later somebody will release a Py3-only extension or tool that's important to you, and that might tip you over to actually using Py3 for a new project (and that will happen for many different values of "you";-).

    Python core development has mostly shifted to the Python 3 area -- while Python 2.7 will be out soon, I'm not sure how many future important enhancements, if any, will keep getting backported to Python 2 versions. In particular, I doubt that Unladen Swallow will be -- if that's the case, then at some point CPython 3 will gain an important speed advantage over CPython 2, which will be the tipping-over factor for other new projects (and ports of existing projects) yet.

    Not sure what gives you the impression that "Python 2 is over all better than Python 3", in terms, of course, of just "Python proper", i.e., the parts that the Python Software Foundation is releasing (core code, libraries, docs...): I strongly disagree with this assessment. Python 3 is better in terms of simplicity (cruft removal) and in having a few features that enable future third-party extensions and tools (such as better metaclass interaction, and syntax for parameter annoutation); I cannot find, in fact, any advantages for Python 2 in terms of "Python proper". The "ecosystem" around Python, as already discussed, is another thing, but that's already progressing (at its own pace, of course, which is definitely not under the control of the Python Software Foundation, but rather of many external groups of developers and a few firms).

    For example, PyQt is already available for Python 3 (as well as 2), and you can use PostgreSQL (a splendid open-source SQL database engine, much more standard than MySql) via py-postgresql. So, if the third party extensions you're pining for are (say) wxpython and mysqldb, perhaps you can try these alternatives (I'm biased, of course, since I've long preferred Qt to wxWidgets, and PostgreSQL to MySQL, on purely technical grounds -- but the prompt porting of the related Python extensions to Python 3 does also hint that these extensions are being more actively and vigorously developed, so that might be another nudge to try them;-).

    0 讨论(0)
  • 2021-02-05 06:14

    The main thing holding Python 3.x back right now is the lack of third-party libraries. I'll be converting my code as soon as SciPy gets ported.

    0 讨论(0)
提交回复
热议问题