This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author chatgris
Recipients chatgris, gvanrossum, vstinner, yselivanov
Date 2014-09-20.22:18:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1411251521.21.0.667425925535.issue22448@psf.upfronthosting.co.za>
In-reply-to
Content
My patch is ready for review, if I followed the process correctly I think you should have received an email

https://codereview.appspot.com/145220043

> By the way I just looked at wait_for.py; it has a bug where do_work() isn't using yield-from with the sleep() call. But that may well be the issue you were trying to debug, and this does not change my opinion about the issue

That was not intended, it was just a mistake.

(A quick aside on yield from, feel free to ignore, I don't expect to change anyone's opinion on this)
I don't use "yield from" much - my first use of asyncio was porting an application from gevent (I made a small custom wrapper with fibers (https://pypi.python.org/pypi/fibers) that can internally yield on coroutines).  I have read https://glyph.twistedmatrix.com/2014/02/unyielding.html but in my cases, I tend to write my code with the thought that any non standard library function can yield (I initially tried porting to vanilla asyncio, but I ended up having yield from almost everywhere). In the rare cases I want to ensure no yielding takes place across function calls, I like the way gruvi (https://github.com/geertj/gruvi) handles it with a construct to assert no yielding takes place.

with assert_no_switchpoints():
    do_something()
    do_something_else()

I also find that it is less error prone (missing a yield from), but that is a minor point as I could write a static analyzer (on top of test cases ofc) to check for that.

But that's just my opinion and opinion's evolve :)
History
Date User Action Args
2014-09-20 22:18:41chatgrissetrecipients: + chatgris, gvanrossum, vstinner, yselivanov
2014-09-20 22:18:41chatgrissetmessageid: <1411251521.21.0.667425925535.issue22448@psf.upfronthosting.co.za>
2014-09-20 22:18:41chatgrislinkissue22448 messages
2014-09-20 22:18:40chatgriscreate