event: (BREAKING CHANGE) bare yield in task now means "cont"
This is more useful and consistent; you can after all just use "return" to end the task, whereas you can now just use "yield" to continue the next frame rather than "yield Task.cont".
This is a follow-up to f6b39345f7, which already enabled this behavior when an __await__ (that is awaited from a task) yielded None.
This commit is contained in:
parent
e8b4b6476c
commit
a64dcd7c5d
|
|
@ -624,8 +624,8 @@ do_python_task() {
|
|||
return DS_done;
|
||||
}
|
||||
|
||||
} else if (result == Py_None && PyCoro_CheckExact(_generator)) {
|
||||
// Bare yield from a coroutine means to try again next frame.
|
||||
} else if (result == Py_None) {
|
||||
// Bare yield means to continue next frame.
|
||||
Py_DECREF(result);
|
||||
return DS_cont;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue