-
Notifications
You must be signed in to change notification settings - Fork 61
Stackless issue #188: enable soft switching for sub-iterators, (async) generators and coroutines #188
Conversation
Further progress needs #190 be resolved first. |
The funny thing, is that "yield from" would be unnecessary if "stackless" soft-switching functionality (a c-stack less execution loop) had been widely embraced. As it is, it is a hack to switch contexts, something that stackless does more effectively and intuitively. And yet, we need to make stackless itself 'aware' of yield from . Tsk, tsk. |
Yes, it is really unfortunate, all the more since Stackless like soft switching can be implemented in every programming language. |
Enable soft switching for iterators/coroutines called by "yield from". Work in progress, not functional, DO NOT MERGE!
…nd coroutines Improve the finalisation of a soft switched YIELD_FROM instruction.
…ed methods Enable stackless calls of the following methods: - generator.send() (generator.__next__() was already stackless); - coroutine.send(); - coroutine_wrapper.__next__() and coroutine_wrapper.send(); - async_generator_asend.__next__() and async_generator_asend.send(). This change needs more tests.
6d1a53a
to
6ab0ae3
Compare
Fix a error handling in the YIELD_FROM finalisation code. Add tests and changelog.txt
It is ready now. This pull request enables stackless calls of sub-iterators and coroutines (technically: the YIELD_FROM opcode) and of the following methods, if soft-switching is enabled:
With this change it is possible to soft switch into/from the compound |
I didn't get any negative feedback yet. Therefore I'll commit the PR. |
This commit fixes an assert statement, that could fail since #188. No functional change.
Enable soft switching for iterators/coroutines called by "yield from".
Work in progress, not functional, DO NOT MERGE!