Simplify the proposal for gen.throw().

This commit is contained in:
Raymond Hettinger 2005-01-03 04:59:21 +00:00
parent 9198b9cf32
commit f868ba34f0
1 changed files with 5 additions and 10 deletions

View File

@ -119,17 +119,12 @@ Specification for Generator Exception Passing:
genraise(), raiseinto(), and flush(). None of these fit as well
as throw().
Note B: The full throw() syntax should exactly match raise's syntax:
Note B: To keep the throw() syntax simple only the instance
version of the raise syntax would be supported (no variants for
"raise string" or "raise class, instance").
throw([expression, [expression, [expression]]])
Accordingly, it should be implemented to handle all of the following:
raise string g.throw(string)
raise string, data g.throw(string,data)
raise class, instance g.throw(class,instance)
raise instance g.throw(instance)
raise g.throw()
Calling "g.throw(instance)" would correspond to writing
"raise instance" immediately after the most recent yield.