[Python-Dev] Raising string exceptions
Guido van Rossum
guido@python.org
Wed, 08 Jan 2003 10:20:39 -0500
> Neal Norwitz <neal@metaslash.com> writes:
>
> > Should the error message when raising an invalid exception:
> >
> > "exceptions must be strings, classes or instances"
> >
> > in ceval.c:2743 be changed to remove strings, since this is
> > deprecated?
[MvL]
> +1.
Maybe change to "string (deprecated)" or change "must" to "should".
> > Also, should we add a PendingDeprecationWarning when raising a
> > string exception?
>
> -0. I think making it a nearly undocumented feature is enough for the
> coming years.
Actually, PendingDeprecationWarning sounds good to me -- that way you
can turn on heavy warnings to review if a piece of code needs work.
In general, everything that's deprecated should at least have a
PendingDeprecationWarning warning attached to it, so there is *some*
way to discover use of deprecated features.