3 ms·
Should we develop on Python 3.x series or 2.x series? Libraries aren't really ready for 3.x series and developing on 2.x series is not making any sense as if 2
by kamaal 15y ago
Should we develop on Python 3.x series or 2.x series?
Libraries aren't really ready for 3.x series and developing on 2.x series is not making any sense as if 2.x ultimately goes away then migration effort on that is not worth.
At the same time 3.x ecosystem is not ready either.
- jacobian 15y agoThe general advice I give is: "Python 3 if you can, Python 2 if you must." That is, if you can use Python 3, you should: it's the future of the language, and it feels it. I find Python 3 significantly more pleasant than Python 2; nearly all the bits that annoy me about Python are fixed in 3. Python 3 is cleaner, the standard library is de-crufted and easier to navigate, and (most important to me) handling unicode doesn't suck. However, as others in this thread note, significant parts of the Python ecosystem haven't finished porting yet (Django, Twisted, yada yada yada). If you rely on one of those things, then stick with Python 2. If that code lives fo a long time you will have to face a porting effort later on, but that's improving somewhat as the community discovers new techniques and creates new tools.
- deleted 15y ago[deleted]
- bobbyi 15y agoMost significant libraries and tools work with 3.x by this point. SQLAlchemy, numpy, scipy, cherrypy, WebOb, pymongo (as pymongo3), virtualenv, pip, pygments, jinja2, tox, nose, ... It's too bad that django, zope and werkzeug (flask) aren't there yet. I understand that a lot of people on this site use django and so these discussions are always dominated by people complaining that they can't use Python 3 because their dependencies (django) aren't available. But the Python community is much bigger than django and today most of the rest of the ecosystem is ready and working fine. The parts that aren't, are getting there rapidly.
- irahul 15y agoYou can write forward compatible 2.x. Here is a small guide to pitfalls and writing forward compatible code: http://lucumr.pocoo.org/2011/1/22/forwards-compatible-python/ http://lucumr.pocoo.org/2011/1/22/forwards-compatible-python... Note that he advises leaving print statement be; it's more familiar in 2.x land, editors often are confused with print function syntax highlighting, and it's easily handled by 2to3.