4 ms·
Tangentially related: of the people and projects that are using Python 3, why? I've found that aside from syntax and a few features here and there, Python 2 and
by justinlardinois 11y ago
Tangentially related: of the people and projects that are using Python 3, why? I've found that aside from syntax and a few features here and there, Python 2 and 3 are more or less the same technology-wise, especially since 2.7 has a lot of features backported from 3. Thus to me it seems better to stick with 2 because there's so many existing libraries and CPython is the only implementation with complete Python 3 support.
If Python 3 had good concurrency and optimization (something neither version has right now), I'd consider using it, but is there an already existing reason that I'm just not seeing?
- fweespeech 11y agoPython 2 has an EOL in 2020. Why start a new project in a language that will have support dropped in ~4 years? If it isn't going to be around in less than 5 years, I'm not going to use it for new projects which have lifespans measured in decades. I've got projects still in production, almost unchanged [only changes were to update business rules], for 4 years. It moves millions of dollars a year. I sure as hell don't want to worry about OS support for it another 4 years.
- antoinealb 11y agoThe amount of libraries working on Python 2 only is really small and not a problem for a lot of us: http://py3readiness.org/ http://py3readiness.org/ The syntax is really nicer IMHO. Unicode strings are really nice to have too. Plus Python 2.x will be EOL'd soon. I just don't see the point of working with it anymore.
- mangecoeur 11y agoSimple answer - It's the current (and currently updated) version. Why would you not use it when starting a new project? More fancy answer - There's plenty of nice improvements to the language (better handling of iterators, tidied up std lib, modern objects, etc), though it's probably worth it for unicode support alone - trying to convince python2 to properly handle international text is just a huge pain (also - no you can't just replace all accented characters with non accented ones if you want to preserve the correct meaning of text and not piss off all your customers by misspelling their names). Yes you can eventually solve all problems with python2. But why bother when you can just use the latest version, there's basically no cost for new projects.
- maw 11y agoit's probably worth it for unicode support alone Yes. I'd probably accept a slightly worse language than python 2 but with reasonable unicode support. Fortunately, there's no need to.
- vegabook 11y agoThere is a very clear cost for many new projects: infinite... for the simple reason that some key libraries still do not do Python 3 at all. Let's be clear. Cassandra is the best large ingest nosql database out there. Python 2 only on CQLSH. Bloomberg. The default terminal used by the 300 000 most important financial people on earth. API Python 2 only. Theano. 3.x via 2to3 only. Anaconda, 2 still the default download with 3 an afterthought (in other words, even for new downloads, 2 still the majority!). This is more than about stuff not being ported yet. It's about people preferring 2.x. This idea that Python 3 is cost free needs to be expunged. For large classes of users, Python 3 is not possible even if they want to (which they don't). Stop this erroneous propaganda. Unicode is nice if you're a web guy, and if you're a web guy, why are you using Python already? Unicode is completely irrelevant for everybody else and is most definitely not a core reason to move to Python 3. You're living in cloud cuckoo land on your 3.x magic mushroom trip. Earth to web jockeys. Python's hardcore is numerical computing, and that hardcore is not on Python 3, and is not moving anytime soon, and certainly not for the dubious benefit of unicode. Moreover the web stack is much less important to Python than is numerical and scientific computing, for the simple reason that while the former has multiple better competitors in the form of golang, JS et al, the latter does not. [sidebar: since when does ascii not cater for accents?? I am bilingual french / english and I have never had a problem typing french accents in ascii? You're creating misleading propaganda again. Once again, EatHeart, I quote you: "I suspect you don't really know what you are talking about...", or worse, you have an agenda to mislead.]
- baq 11y ago>Unicode is completely irrelevant for everybody else and is most definitely not a core reason to move to Python 3. You're living in cloud cuckoo land on your 3.x magic mushroom trip. you're from the US, right? there's about 6 billion people for whom ascii isn't enough. some of them program in python.
- e1ven 11y agoFor me personally, I've had much better experiences with Py3 than I ever did with Py2. I've used Py3 for most of my projects since 2012, and I've never run into any major problems. Despite what people like to say on forums, pretty much every library I'd want to use works fine. And it has for a long time. When I've tried to go back and use Py2, I keep getting annoyed by simple things. The unicode is a pita. Not having keyword-only arguments is annoying. Not having "yield from" means more dancing. Py2 forces me to manually make a lru_cache decorator, instead of just working.. From my perspective, sure, I _could_ use Python 2.x.. But Python3 works better and is easier. The question isn't "Why Python3", it's "Why the fsck wouldn't you?"
- SiVal 11y agoPython 3 has the advantage of having a future. It is the living branch of the language. The advantage of Python 2 is an evaporating pool of legacy Python2-only libraries and legacy Python2-only programmers. Python2 is dying at the rate that pool is evaporating. Python 3 has the advantage of having a future, plus all the advantages of Python 2 and more with the exception of that shrinking pool. I have already replaced all my Python 2 code and won't intentionally write more code that I know will have to be replaced. I'd like anything I build now to have the greatest likelihood of still being something I can continue building on in the future. Python 3 is more likely to fit that requirement than Python 2. I'm teaching my kids to program. Python 3 is a good choice for doing so. Python 2 would set them up to be teenage maintenance programmers. Doing that to them would be child abuse. I upgrade my own skills, too, so wouldn't choosing Python 2 for my own upgrades be a form of self-abuse?
- keyneus 11y agoType annotations. They're the sole reason we moved from Python2 to Python3, and it was completely worth it. With mypy, we now have at least some semblance of a type system and type checking, which is a huge win. Unicode support is vastly improved. Finally there are have specific exceptions like FileNotFoundError so you don't have to catch OSError and then check errno. I got so tired of that. No more old-style classes, which means you know you can use super(), which is now less annoying since you don't need to “remind” Python which class you're in. Lots of other small changes, most of which do lead to improvements, however minuscule. I would argue that unless you are must use a Python2-only library, just go with 3.
- laurencerowe 11y agoI held of switching to Python3 until last year because I was worried about library support. But we're at a point now where the vast majority of currently maintained libraries are Python 3 compatible. In the end what pushed me over were the improvements to the standard library multiprocessing module only available in Python 3.
- antod 11y agoI've been slow to move to 3.x, but have just recently started using 3.4 as my first Python 3. I never had any problem with 3.x conceptually, I was just slow/lazy and because I could see how each new 3.x release got better and better there wasn't much rush. I always thought I would move to 3.x one day. And 2.7 was a nice place to wait for awhile across distro upgrades. I haven't bothered with any migration of old code yet - just starting new stuff in 3.4. I've got one project that aims to be 2.7/3.4+ bilingual and it's going well so far. Now that I've tried it I do like 3.4 - four releases of small feature improvements do add up eventually. I think Python's strategy of keeping 2.7 around for a long time to let stuff migrate when ready is a good one. Each new 3.x release also makes migration from 2.7 a bit easier. Not worrying about supporting 3.0, 3.1 or 3.2 (and 3.3 even?) also makes migration easier too. I'd recommend moving to 3 for new projects. Migrating existing projects is more of a case by case deal where it may or may not be worth it yet or even ever.