[Python-checkins] python/nondist/peps pep-0343.txt,1.24,1.25

rhettinger@users.sourceforge.net rhettinger at users.sourceforge.net
Fri Jun 17 23:59:12 CEST 2005


Update of /cvsroot/python/python/nondist/peps
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23023
Modified Files:
	pep-0343.txt 
Log Message:
Optional arguments for throw() to match raise syntax
Index: pep-0343.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0343.txt,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- pep-0343.txt	11 Jun 2005 05:14:20 -0000	1.24
+++ pep-0343.txt	17 Jun 2005 21:58:59 -0000	1.25
@@ -167,10 +167,10 @@
 log it; the generator is not allowed to yield another value, since
 the with-statement should not be usable as a loop (raising a
 different exception is marginally acceptable). To enable this, a
- new throw() method for generators is proposed, which takes three
- arguments representing an exception in the usual fashion (type,
- value, traceback) and raises it at the point where the generator
- is suspended.
+ new throw() method for generators is proposed, which takes one to
+ three arguments representing an exception in the usual fashion
+ (type, value, traceback) and raises it at the point where the
+ generator is suspended.
 
 Once we have this, it is a small step to proposing another
 generator method, close(), which calls throw() with a special
@@ -273,7 +273,7 @@
 The syntax for generator functions is extended to allow a
 yield-statement inside a try-finally statement.
 
- New generator method: throw(type, value, traceback)
+ New generator method: throw(type, value=None, traceback=None)
 
 g.throw(type, value, traceback) causes the specified exception to
 be thrown at the point where the generator g is currently


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /