[Python-3000] Pre-peps on raise and except changes
Jim Jewett
jimjjewett at gmail.com
Wed Jan 24 00:22:24 CET 2007
On 1/23/07, Collin Winter <collinw at gmail.com> wrote:
> Does this language work for you?
> """
> 2. ``raise E`` (with a single argument) is used to raise a new
> exception. This form has two sub-variants: ``E`` may be either an
> instance of ``BaseException`` [#pep352]_ or a subclass of
> ``BaseException``. If ``E`` is a subclass, it will be called with
> no arguments to obtain an exception instance.
>
> To raise anything else is an error.
> """
It works for me. In particular, it even clears up the pathological
case of an object which is both a subclass and an instance of
BaseException.
-jJ
More information about the Python-3000
mailing list