Brett Cannon <br...@python.org> added the comment:

On Mon, Sep 7, 2009 at 13:01, Jean-Paul Calderone<rep...@bugs.python.org> wrote:
>
> Jean-Paul Calderone <exar...@divmod.com> added the comment:
>
> Hm.  That PEP is marked as rejected, though.  I guess it was partially
> implemented, those changes included in the Python 2.5 release, and then
> it was decided that it was a bad idea, rejected, and the changes undone
> for 3.x (what about 2.7)?  Or did something else happen?
>

I screwed up and pasted in the URL for the wrong PEP. Sorry about
that. Written a few too many PEPs involving exceptions. The correct
one is http://www.python.org/dev/peps/pep-0352/ .

> I did a simple search on the PEP for the word "message", but the word
> doesn't appear anywhere in the text!  So I guess it's a feature that's
> implied by the PEP, but I would appreciate some help figuring out the
> implication.
>
> Here's what I do see:
>
>  - If one argument is passed to BaseException.__init__, then the value
> is used as the value for the message attribute.
>  - If zero or more than one arguments are passed, then the attribute is
> given the empty string for a value.
>  - If zero or one arguments are passed, the message attribute is used
> as the string representation of the exception instance.
>
> The deprecation warning emitted in 2.6 doesn't tell me which of these
> things is deprecated, though.  Is there something more to the message
> attribute, or are one or more of the above list things which should no
> longer be relied on?

The 'message' attribute itself is deprecated as it didn't exist prior
to being introduced in 2.5. The original idea was to not let
BaseException take multiple arguments to its constructor and have
message be what replaced 'args'. But when I tried to do that at PyCon
2007 the pain was too great so it was decided a more long-term
strategy to making BaseException accept a single argument was needed.
So the 'message' attribute that got added to BaseException was
retracted.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue6844>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to