Record BDFL opinion on exception-raising style
This commit is contained in:
parent
cbbce90c40
commit
ac8c835cce
|
@ -546,6 +546,13 @@ Programming Recommendations
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue