[New-bugs-announce] [issue6777] Python 2.6 tutorial still recommends using Exception.message attribute
Christoph Zwerschke
report at bugs.python.org
Mon Aug 24 21:50:34 CEST 2009
New submission from Christoph Zwerschke <cito at online.de>:
The Python 2.6.2 tutorial says at the end of secton 8.3
(http://docs.python.org/tutorial/errors.html#handling-exceptions):
"But use of .args is discouraged. Instead, the preferred use is to pass
a single argument to an exception (which can be a tuple if multiple
arguments are needed) and have it bound to the message attribute."
It seems this is not true any more, the idea has been retracted so that
it's now the other way around again: .args can still be used,
but .message is deprecated (see http://www.python.org/dev/peps/pep-
0352/#retracted-ideas).
The examples classes in section 8.5 of the Tutorial, using the .message
attribute should be also adapted because they raise a
DeprecationWarning in Python 2.6.2.
----------
assignee: georg.brandl
components: Documentation
messages: 91937
nosy: cito, georg.brandl
severity: normal
status: open
title: Python 2.6 tutorial still recommends using Exception.message attribute
versions: Python 2.6
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6777>
_______________________________________
More information about the New-bugs-announce
mailing list