Earlier quoted context omitted.
from __future__ import print_function on python2 solves the print function incompat.
Exactly this Why is changing 'print stuff' to 'print (stuff)' such a big deal? I think 2To3 solves a lot of print cases https://docs.python.org/2/library/2to3.html
Making Python 3 more attractive
71–80 of 172 posts
Re: Making Python 3 more attractive
#72Reasons I am excited about Python 3: * "yield from" * Unicode support (I'm German and the clear distinction between bytes and unicode really makes my life easier) * function annotations (PyCharm interprets them and uses them for static type checking) * cleaned up stdlib (not only names, but also features) * asyncio Library support is very good nowadays, pretty much all of the important libraries are either ported to…
- Laptop running Ubuntu Trusty: Python 3.4
- Production servers with Debian Wheezy: Python 3.2
- Laptop running Fedora 20: 3.3.2
You don't usually install Python in Linux using upstream, you install the version provided by your distribution and unfortunately Python 3 has differences between these versions (eg, "yield from" was introduced in 3.3, IIRC), whilst 2.7.x it's been without changes for a long time.
Even Apple includes 2.7 now (handy when I distribute a game made with Pyglet); so I'm excited too, but Python 2 still makes my life easier.
Re: Making Python 3 more attractive
#73> Windows has the CreateFiber() API that creates "fibers", which act like threads, but use "cooperative multitasking". For POSIX, using a combination of setjmp(), longjmp(), sigaltstack(), and some signal (e.g. SIGUSR2) will provide coroutine support though it is "pretty awful". While it is "horrible", it does actually work. I do this, and it works perfectly well. Here's a full implementation demonstrating this appro…
https://github.com/python-greenlet/greenlet/tree/master/plat...
Re: Making Python 3 more attractive
#74The article mentions stackless Python. My understanding is Guido didn't want to merge it because it would break backwards compatibility with extensions. That was a long time ago when Python's userbase was much smaller. I wonder if Python be in better shape today had they merged stackless back then.
https://www.google.com/trends/explore#q=Python%20programming...
Re: Making Python 3 more attractive
#75Python developers would almost all upgrade in a single minute for 30%+ better performance. It's interesting that performance wasn't a topic at this rump session as reported; I moved over to Go about a year ago, and while I miss Python's expressivity at least once a week, I'm just not willing to slow down all my programs by 5x. On the other hand, if Python could double in speed, I'd likely try to rework it into our wo…
>Python developers would almost all upgrade in a single minute for 30%+ better performance. But strangely they don't - PyPy has hardly gained traction (albeit the python2->python3 switch didn't help) and looking at the benchmarks that's more like 5-7x performance. I suspect that most often, in places where performance matters enough in a way that would warranted refactoring a code-base from cpython to PyPy, they alre…
Re: Making Python 3 more attractive
#76OK... so from a _practical_ perspective, can someone tell me why I should move to python 3? None of the arguments presented to switch are strong enough :-/
Re: Making Python 3 more attractive
#77Just make it faster and everybody will move. No need for fancy new stuff... I'm eager.
Re: Making Python 3 more attractive
#78Earlier quoted context omitted.
There are a lot of Windows users who are happy with XP too. I remember trying to explain to people 20 years ago why HDTV was better than what they had. Most people were happy with 480 lines of resolution, or thought they were. It's human nature. By being accommodating, you've made the problem harder. Apple is the only company that says screw legacy. Of course users complain but they just grumble and know to accept it…
But Swift is an actual example of something with no legacy to worry about. Instead of being Objective C++2015, it's an entirely new language. And, more importantly, Apple can give guidance that people have to follow. As Swift matures, regresses, and has the bugs worked out of it, and library support is fully developed, Apple can arbitrarily identify a point at which Objective C just has to die, and the developers (if…
Re: Making Python 3 more attractive
#79Re: Making Python 3 more attractive
#80It's not about a need for new features. It's about basic quality control. I recently ported a medium-sized production system (the back end of "sitetruth.com") from Python 2 to Python 3. It took about a month. Not because of the language changes, but because several major third-party packages were discontinued for Python 3, and their replacements were buggy. Specifically: - Python 3 forces you to use CPickle instead o…
If you can dump Apache, uwsgi and nginx is (imho) a much nicer way to host python apps.