3 ms·
That would have helped a lot, yeah. Also, dealing with exceptions in an intuitive way when you have a "fake" stack you're managing yourself is a drag. The per
by jamwt 12y ago
That would have helped a lot, yeah. Also, dealing with exceptions in an intuitive way when you have a "fake" stack you're managing yourself is a drag. The performance of of managing your own stack also sucks.
But probably the biggest practical issue is there is a terrible, common silent mistake pattern, that bit us over and over again:
self.do_something_async() # it's a generator
What you really wanted to do was to `yield` this so the reactorish element in the frame above you consumes it. Instead, you created a NOOP generator that is never consumed, so whatever work you thought you did, silently.. does nothing.
Anyway, I think `yield from` helps you get around some of this stuff, but I haven't been keeping up with tulip. Which is probably kind of silly since Guido works like 50 feet away from me.
Btw, hi Donovan. :-)
- zaius 12y agoWhat was tulip (and is now asyncio in 3.4) has a debug flag that you can enable to detect if a coroutine is scheduled but never called. More info here: https://docs.python.org/3/library/asyncio-dev.html#detect-coroutine-objects-never-scheduled https://docs.python.org/3/library/asyncio-dev.html#detect-co...
- fzzzy 12y agoThanks for the tip, that's really useful info.
- fzzzy 12y agoHi Jamie. That's some really interesting insight, thanks! I'm toying with generators in javascript now and I can see forgetting the yield being an issue. The other reply to your comment seems to suggest there is a solution though, I'll have to look into that. Greenlet giving great exception stacks sure is nice, and greenlet's performance is REALLY nice. (Can you believe it has been almost 10 years??)