diff --git a/pep-0288.txt b/pep-0288.txt index f2eb94b8e..25e45c9ad 100644 --- a/pep-0288.txt +++ b/pep-0288.txt @@ -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.