Christian Tismer wrote:
Would you raise an exception if something is called that is not a cofunction? Or would that be an ordinary call?
A cofunction calling a non-cofunction is fine, it just makes an ordinary call. But if a non-cofunction tries to call a cofunction using an ordinary call, an exception raised. Effectively, cofunctions do *not* implement __call__ (instead they implement a new protocol __cocall__).
The only difference is that I'm not aiming at coroutines in the first place, but just having the concept of a *suspendable* function.
I'm not sure what the distinction is.
What has happened to the PEP, was it rejected?
No, its status is still listed as "draft". It's probably too soon to consider whether it should be accepted or rejected; we need more experience with yield-from based task systems first. -- Greg