A question about the posibility of raise-yield in Python

Lie Ryan lie.1296 at gmail.com
Fri Apr 16 08:57:41 EDT 2010


On 04/16/10 02:30, Terry Reedy wrote:
> On 4/15/2010 9:34 AM, Дамјан Георгиевски wrote:
>> I'm writing this as a complete newbie (on the issue), so don't be
>> surprised if it's the stupidest idea ever.
>>
>> I was wondering if there was ever a discusision in the python community
>> on a 'raise-yield' kind-of combined expression. I'd like to know if it
>> was proposed/rejected/discussed/not-decided yet??
> 
> 
> The idea of resumable exceptions has been discussed and so far rejected.
> I presume the cost in complication of both the language and
> implementations is seen as too high.
> 

I once proposed a similar construct a couple of years ago (it was also
one of my first post in this group)
http://groups.google.com/group/comp.lang.python/browse_thread/thread/ac62e0fe69304c6f/ec95518c16e8b9dc?q

And also, in the last few weeks (or so), there was a thread in
python-ideas mailing list proposing "yieldfrom":

yieldfrom iterable

is equivalent to:

for n in iterable:
    yield n

which is practically the same as what I was and raise-yield is
proposing. The difference being that SoftException/raise-yield silently
re-raise the exception, while yieldfrom is an explicit re-raise.



More information about the Python-list mailing list