Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the benefits / advantages of using Python 3? [closed]

One of my clients is a large media organization that does a lot of Python development for its own in-house business process management. We need to weigh in the pros and cons of switching the entire code base from Python 2.7 to Python 3, and also for doing any new development using Python 3.

My question is: How would you sell Python 3? What are some tangible benefits that we could get out of using it?

A quick google didn't turn up many concrete benefits, other than the occasional rather vague "it might speed up your code in some cases". Perhaps I'm not looking where I should be, so I would also appreciate pointers to resources where this is discussed.

like image 632
Jordan Dimov Avatar asked Jul 11 '13 12:07

Jordan Dimov


2 Answers

python 3 is gaining popularity, but changing code base is always a hassle

python 3 advantages:

  • the GIL has been improved a lot so it locks up much less.
  • built ins return generator expressions

python 3 disadvantages:

  • some libraries have yet to be ported to python 3

I like python 3 but the fear of finding a cool python 2 only library is what keeps my boss from daring changing to python 3...

if you were starting from scratch it might make sense as a long term investment to code in python 3 but I think it is to early to switch as python 2 has many years of support left and it will probably have better library support for the next 3 years as well

like image 143
jcr Avatar answered Nov 14 '22 21:11

jcr


Since you're already in 2.7, you should stick around for a bit longer. Python 3 is great, but it's very different. In addition, most Linux distros still come with Python 2. Also, it's slightly lacking in libraries. Not even Twisted is available.

The benefits are the new features, such as the new statistics module, the yield from statement, the pathlib module, and the like. Besides, you'll have to switch from Python 2 at some point in time anyway; why not sooner than later, when there's more code that takes longer to port?

If you want a more thorough comparison, see http://wiki.python.org/moin/Python2orPython3.

like image 35
kirbyfan64sos Avatar answered Nov 14 '22 22:11

kirbyfan64sos