11 ms·
Python 3 keeps getting better and better. I've been writing more code in Python 3 than 2 for about three years now, and I absolutely love it. When I have to wri
by redsymbol 11y ago
Python 3 keeps getting better and better. I've been writing more code in Python 3 than 2 for about three years now, and I absolutely love it. When I have to write code in 2.7 now, it feels like shifting from fifth gear down to second.
- rizwank 11y agoIs Py3 ready for prime time? Do all the right libraries have support now?
- vikp 11y agoYes -- I write ~95% of my python code in 3, and scrapy is the only library I commonly use that doesn't support it. Here's a listing of package compatibility: http://py3readiness.org/ http://py3readiness.org/.
- kodr 11y agoand the other one: https://python3wos.appspot.com/ https://python3wos.appspot.com/
- nickysielicki 11y agoIt's been ready for prime time for the past 3 years.
- deleted 11y ago[deleted]
- jay_kyburz 11y agoUnfortunately I'm stuck on 2.7 until Google updates App Engine
- wyldfire 11y agoMost of the time I find it pretty easy to make it compatible with both 2.7 and 3.4. Usually just a few "from __future__ import print_function" and a few other tips. If your codebase is large, it can feel daunting, but it's not usually that bad.
- foob 11y agoIn most cases, yes. There are libraries that you might want to use that don't support it yet but the vast majority do. Personally, I'm anxiously waiting for Fabric 2 which has been pending for a long time. This is a good resource for figuring out whether the libraries you need are ready: http://py3readiness.org http://py3readiness.org
- nstart 11y agoPy3 has been prime time for a while now. Been using it full time since Py 3.3 for all my work and I haven't had any issues with it. There were some external libraries such as the library given by a twilio competitor that were incompatible, but easily fixed (almost exclusively, encoding issues). Although, I still find myself running tests and cursing at the fact that I keep writing print "string" without the brackets :D
- sadgit 11y agoCare to share some highlights? Fifth to second sounds like a big difference!
- inglor 11y agoIt has the ability to statically check the type system, that's amazing. Moreover async/await with async resource management (which C# doesn't have yet) gives it a real edge for server development.
- ColinDabritz 11y agoWhat is async resource management? can you link to docs for the features you mean? I'm having trouble googling this one, maybe different keywords are used?
- 1st1 11y agoI think inglor refers to the new 'async with' statement: https://docs.python.org/3/reference/compound_stmts.html#async-with https://docs.python.org/3/reference/compound_stmts.html#asyn... Using it you can safely cleanup/commit transaction/release lock/etc when exiting a block of statements (even if an exception was raised). Plain 'with' statement cannot call asynchronous code in '__exit__' methods, 'async with' can do that (in '__aexit__').
- sadgit 11y ago> has the ability to statically check the type system I was under the impression that type checking was not one of the goals of PEP 484 etc.
- useerup 11y ago> Moreover async/await with async resource management (which C# doesn't have yet) In C#, the using statement combines with async/await. It is cool that Python finally gains proper async/await, there is no need to diss other languages.
- 11y ago
- wfunction 11y ago> When I have to write code in 2.7 now, it feels like shifting from fifth gear down to second. You mean, second gear up to fifth? I tried writing some Python 3 code and the lack of parameter tuple unpacking by itself stunned me and drove me crazy, never mind other stuff. Python 3 seems very user-unfriendly compared to Python 2. Won't touch it with a ten foot pole unless my life depends on it.
- jay_kyburz 11y agoProbably means from 3rd gear down to 2nd.
- orf 11y agoI've been using Python for 7+ years, and I had no idea parameter tuple unpacking was a thing. Never once seen any code that uses it, or seen anyone mention it. If you think the (rightful) removal of a hardly used feature[1] that has some big problems is a blocking issue then I feel sorry for you. Py3 is awesome. 1. https://www.python.org/dev/peps/pep-3113/ https://www.python.org/dev/peps/pep-3113/
- dvlsg 11y agoInteresting. Javascript is actually adding something very similar, calling it destructuring. It's actually quite handy - although admittedly more handy for destructuring object arguments than array arguments.
- ben336 11y agoPython 2 & 3 have destructuring. This is talking about having def fxn(a, (b, c), d): pass Be a valid function signature. So the destructuring is held in the function definition. Python 3 will still allow def fxn(a, x, d): (b, c) = x pass Both Python and ES6 JavaScript allow destructuring arrays: //javascript let [x, y] = [1,2] #python [x, y] = [1,2] (x, y) = (1,2)
- Arnavion 11y ago