[Python-3000] Pre-peps on raise and except changes

Brett Cannon brett at python.org
Thu Jan 25 20:09:24 CET 2007


On 1/24/07, Collin Winter <collinw at gmail.com> wrote:
> On 1/23/07, Brett Cannon <brett at python.org> wrote:
> > I just realized I misread your paragraph and took E to represent an
> > exception class, not a nebulous object that could be an exception
> > class or instance.
>> That's what I figured. Is it clearer if E is changed to EXCEPTION?
>> """
> 2. ``raise EXCEPTION`` is used to raise a new exception. This form has
> two sub-variants: ``EXCEPTION`` may be either an instance of
> ``BaseException`` or a subclass of ``BaseException`` [#pep352]_.
> If ``EXCEPTION`` is a subclass, it will be called with no arguments
> to obtain an exception instance.
> """
>
I guess. I would just say "is used to raise a new exception, either a
class or instance" and then explain the restrictions. But this could
easily just be a quirk of my head. =)
-Brett


More information about the Python-3000 mailing list

AltStyle によって変換されたページ (->オリジナル) /