exception attributes

Frederic Giacometti fred at arakane.com
Sun Aug 19 17:26:44 EDT 2001


"Andrew Dalke" <dalke at acm.org> wrote in message
news:9lp2ek$uou$1 at slb7.atl.mindspring.net...
>
> Frederic Giacometti wrote:
> >All exception classes must be subclasses of the Exception standard class
> >(see standard documentation, or use some common sense ;)).
>
> Technically,
> ] All user-defined exceptions should also be derived from this
> ] class, but this is not (yet) enforced.

Hopefully, Python is not a police-directed totalitarian language; and our
beloved Napoleonic BDFL is there to protect us from the enforcement
straightjacket for everybody :)).
[ Longue vie a l'Empereur Defenseur des Libertes! :))) ]

...
> So there are still two old-style string exceptions in the 2.2 Python
> code, although class exceptions do all finally derive from Exception.

String exceptions refer to the exception value used when raising the
exception.
But even then, string exceptions must be associated to an exception class,
to which the above rule applies...

FG






More information about the Python-list mailing list