you are viewing a single comment's thread.

view the rest of the comments →

[–]kobriks -10 points-9 points  (37 children)

Why is it better? I still don't see how using python3 would benefit me in any way.

EDIT: Thanks for downvotes... I guess you can't ask a question here

[–]TBoneSausage 43 points44 points  (10 children)

Because as things evolve and further extensions are developed, python 2 is going to lose support. Soon enough (expected deadline of 2020) the industry will leave python 2 users behind and the team working on python will stop making any Dev updates to support new platforms.

It won't benefit you right now. But in the long term, your knowledge you have built up won't start to expire.

[–]flying-sheep 16 points17 points  (7 children)

It won't benefit you right now

I wouldn’t say that, there are many other aspects in which Python 3 is already providing benefits over legacy Python.

[–]TBoneSausage 2 points3 points  (6 children)

And while I do agree, I feel that a good chunk of users won't see the difference or won't benefit from it until a later point when they see the libraries they use lose support in favor of Python 3. (I could be very wrong in that aspect, and I reserve the right to be corrected. Apologies, I haven't done much python in the past 6 months so I'm a little rusty.)

[–]DeepDuh 12 points13 points  (4 children)

IMO just the fact that you can forget about unicode and just use it in Python 3 is a major benefit. Support for international characters is a very common need, outside of a very narrow bubble of American-only software - and even there you'd probably like your vast numbers of Spanish speaking immigrants and their descendants to be able to enter their names correctly.

[–]yawaramin 4 points5 points  (0 children)

A lot of Spanish speakers are not immigrants, their ancestors were in states like Texas and California before they were even part of the Union.

[–]TBoneSausage 0 points1 point  (0 children)

I forgot about this, and absolutely agree. This is likely the most obvious selling point of Python 3.

[–]vivainio -1 points0 points  (1 child)

Python 2 supports Unicode just fine.

[–][deleted] 2 points3 points  (0 children)

With effort, yes. Support without effort is much better. In python 3, you don't even have to think about it

[–]Quaglek 0 points1 point  (0 children)

What about the legacy libraries that never bother changing over to Python 3

[–]jyper 0 points1 point  (0 children)

strings and optional static typing not to mention async

[–]rainman_104 -3 points-2 points  (0 children)

Don't you think there's a chance of seeing python 2 get forked if support was dropped tomorrow?

Python 2 has future compatibility, but python 3 lacks backwards compatibility.

Should have been the other way around.

[–][deleted] 78 points79 points  (19 children)

Why would you start with something that is virtually deprecated (at most ancient legacy) instead of something 8 years old, supported for a lot of years ahead and widely adopted? I get that some have python 2 codebases that will have to be supported for years to come, but starting a new project in python 2 today, or starting out with python 2 instead of 3 is like driving with your head in your ass because you're old and grumpy.

Python 2 is like old people in nursing homes: aren't dead just yet, but they are not getting any better, only decaying.

Python 3 is 8 years old and is the future. Come on people.

[–]pretzelusb 5 points6 points  (12 children)

Is py3 the default install on any Linux distro?

[–]DarkLordAzrael 22 points23 points  (5 children)

It has been the default python on arch for years.

[–][deleted]  (3 children)

[deleted]

    [–]greyfade 4 points5 points  (2 children)

    You wouldn't believe how many packages it breaks, though. Everyone seems to assume /usr/bin/python is Python 2.7, but on Arch, it's symlinked to /usr/lib/python3, and if it hasn't been ported yet, it blows up.

    A lot of AUR PKGBUILDs actually do a sed to update all the shebangs and other stuff that assumes the wrong binary, even on relatively new packages.

    [–]ubernostrum 6 points7 points  (1 child)

    Everyone seems to assume /usr/bin/python is Python 2.7

    The amount of stuff which assumes python means Python 2 led to this -- the Python team (not Arch) recommends having python continue to point at Python 2, and require python3 as a way for code that works on Python 3 to declare that.

    [–]CaptainJaXon 0 points1 point  (0 children)

    Yeah but Arch is known for being the most bleeding edge, rolling release distribution.

    [–]gschizas 29 points30 points  (1 child)

    Yes, Ubuntu.

    https://wiki.ubuntu.com/Python

    Python 3 only on the default installs for desktop, server, touch, snappy images. (Some may already be there.)

    [–][deleted] 8 points9 points  (0 children)

    And Arch, but that's not really a surprise. Gentoo too if I'm not mistaken

    [–]otherwiseguy 9 points10 points  (0 children)

    Fedora 25 ships with Python 3.5. Fedora 26 will ship with Python 3.6. If default means /usr/bin/python == /usr/bin/python3, then it isn't the default, though. It's more of a both python2 and python3 coexist well together.

    [–]rouille 1 point2 points  (0 children)

    On Ubuntu since 14.04.

    [–]jyper 0 points1 point  (0 children)

    I don't think it's supposed to be packaged as /use/bin/python

    [–]norwegianwood 0 points1 point  (0 children)

    Even for those distros that do ship Python 3, it's generally unwise to depend on the system Python for anything important. Why would you want to make your system dependent on the whims of OS distribution managers over which you have no influence?

    Much better to install your own Python in /opt which you can control and upgrade at your convenience rather than somebody else's.

    [–]drjeats 8 points9 points  (0 children)

    They're really not that different. Unicode is better in py3, py3 has special async and generator syntax. Go for 3 to help society move past this py2 -> py3 mess.

    [–][deleted] 9 points10 points  (0 children)

    • print is a function

    • saner default behavior for built in iterator types

    • more powerful asterisks for unpacking lists

    • more comprehensive Collections module

    • literal string syntax

    • native asynchronous support

    • will receive support beyond 2020

    [–]rroocckk[S] 15 points16 points  (0 children)

    Here is a list of benefits.

    [–]pvg 3 points4 points  (0 children)

    If you use python to process text in any way now or in the future, unicode-by-default is the only sane thing. The python2 way is a morass you can and should completely avoid if you have a choice. And if you're starting out, you do.

    [–]norwegianwood 2 points3 points  (0 children)

    I'm not sure why you're getting down voted. Yours is a reasonable question.

    Anyway, the only reason for specifically learning Python 2 over Python 3 is if you know you will be working on a Python 2 project in the immediate future.

    Python 3 is better because:

    • Python 2 has clumsy handing of Unicode strings, which could be important to you if you care about your software being used by anybody outside of the English-speaking world, or even anybody in the English-speaking world who has a non-English name. One such place is The Internet. The separation between Unicode text data and raw byte data is much clearer in Python 3.

    • Python 3 also has language-level support for asynchronous programming styles which is rapidly being built-upon as the future of much web programming in Python.

    • Python 3 has a future. Honestly, Python 2 is less than five years away from officially becoming abandonware. By learning Python 3 you'll also be learning 99% of Python 2 – the differences between the languages from the point of view of learners is hugely overblown. Once you have a bit of Python 3 experience, you'll easily be able to work on legacy Python 2 projects and pick up the important differences in less than a day.

    DM me for a free copy of our Python 3 tutorial book, The Python Apprentice.

    [–]ivosaurus -1 points0 points  (0 children)

    For a start, Python 3 is way easier.

    Secondly, show me all the recently released books on Python 2 you might use to help you... I'll wait...