[Python-checkins] python/nondist/peps pep-0008.txt,1.25,1.26
akuchling@users.sourceforge.net
akuchling at users.sourceforge.net
Sun Aug 7 15:27:56 CEST 2005
Update of /cvsroot/python/python/nondist/peps
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6634
Modified Files:
pep-0008.txt
Log Message:
Record BDFL opinion on exception-raising style
Index: pep-0008.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0008.txt,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- pep-0008.txt 6 Aug 2004 18:47:26 -0000 1.25
+++ pep-0008.txt 7 Aug 2005 13:27:54 -0000 1.26
@@ -546,6 +546,13 @@
class MessageError(Exception):
"""Base class for errors in the email package."""
+ When raising an exception, use "raise ValueError('message')"
+ instead of the older form "raise ValueError, 'message'". The
+ paren-using form is preferred because when the exception
+ arguments are long or include string formatting, you don't need
+ to use line continuation characters thanks to the containing
+ parentheses. The older form will be removed in Python 3000.
+
- Use string methods instead of the string module unless
backward-compatibility with versions earlier than Python 2.0 is
important. String methods are always much faster and share the
More information about the Python-checkins
mailing list