This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author brett.cannon
Recipients aisaac, brett.cannon, dgrisby, exarkun, ivank
Date 2009-09-07.20:32:47
SpamBayes Score 1.6708002e-07
Marked as misclassified No
Message-id <bbaeab100909071332l24cc3773tc59e0df79afce22e@mail.gmail.com>
In-reply-to <1252353709.33.0.37505035771.issue6844@psf.upfronthosting.co.za>
Content
On Mon, Sep 7, 2009 at 13:01, Jean-Paul Calderone<report@bugs.python.org> wrote:
>
> Jean-Paul Calderone <exarkun@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.
History
Date User Action Args
2009-09-07 20:32:49brett.cannonsetrecipients: + brett.cannon, dgrisby, exarkun, ivank, aisaac
2009-09-07 20:32:47brett.cannonlinkissue6844 messages
2009-09-07 20:32:47brett.cannoncreate