[Python-Dev] GeneratorExit is unintuitive and uneccessary
Igor Bukanov
igor.bukanov at gmail.com
Thu Aug 24 00:52:09 CEST 2006
On 8/23/06, Phillip J. Eby wrote:
> Our original
> assumption was that if they could implement throw() then they could clearly
> implement close(), since close() was defined in terms of throw(). An
> asynchronous return might be another matter.
Such asynchronous return can always be implemented via a special
hidden exception that is invisible to catch statements. I.e an
implementation of generators can still use ___GeneratorExit
internally as long as it is not exposed to scripts.
Regards, Igor
More information about the Python-Dev
mailing list