Eric Fahlgren wrote:
I don't think it's possible to avoid instantiating the exception at the
user level, what would sys.exc_info() do about it's second return value?
The exception could be instantiated if and when sys.exc_info() gets called.
--
Greg
On Thu, May 31, 2018 at 10:55 PM Greg Ewing
wrote:
> Ethan Furman wrote:
>
> > Why is this? Doesn't the exception have to be instantiated at some
> > point, even if just to print to stderr?
>
> If it gets caught by an except clause without an else clause,
> in theory there's no need to instantia
On Thu, 31 May 2018 14:00:24 -0400
Alexander Belopolsky
wrote:
>
> Is this really true? Consider the following simple code
>
> class E(Exception):
> def __init__(self):
> print("instantiated")
>
> try:
> raise E
> except E:
> pass
>
> Is it truly necessary to instantiate E