On 24.08.2016 21:00, Yury Selivanov wrote:
For an async generator there are two cases: either it tries to yield
another value (the first time this happens you can throw an error
back into it) or it tries to await -- in that case you can also throw
an error back into it, and if the error comes out unhandled you can
print the error (in both cases actually).
It's probably to specify all this behavior using some kind of default
finalizer (though you don't have to implement it that way).
Hopefully there will be other discussion as well, otherwise I'll have
to accept the PEP once this issue is cleared up. :-)
Curious to hear your thoughts on two different approaches to
finalization. At this point, I'm inclined to change the PEP to use
the second approach. I think it gives much more power to event loops,
and basically means that any kind of APIs to control AG (or to
finalize the loop) is possible.
I think your alternative approach is the better one. It feels more
integrated even though it's harder for event loop implementors (which
are rarer than normal event loop users). Also AG finalization is
something that's not really custom to each AG but makes more sense at
the event loop level, I think.
Best,
Sven
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com