From f868ba34f03b80eeae9eafa5c7af62e895b1e0d1 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Mon, 3 Jan 2005 04:59:21 +0000 Subject: [PATCH] Simplify the proposal for gen.throw(). --- pep-0288.txt | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) 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.