Joshua Moore-Oliva added the comment:

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 :)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22448>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to