Issue 6777: Python 2.6 tutorial still recommends using Exception.message attribute (original) (raw)
Issue6777
Created on 2009-08-24 19:50 by cito, last changed 2022-04-11 14:56 by admin. This issue is now closed.
Messages (2) | ||
---|---|---|
msg91937 - (view) | Author: Christoph Zwerschke (cito) * | Date: 2009-08-24 19:50 |
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. | ||
msg92250 - (view) | Author: Georg Brandl (georg.brandl) * ![]() |
Date: 2009-09-04 11:33 |
Thanks, corrected in r74653. |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:56:52 | admin | set | github: 51026 |
2009-09-04 11:33:42 | georg.brandl | set | status: open -> closedresolution: fixedmessages: + |
2009-08-24 19:50:33 | cito | create |