[Python-Dev] Re: PEP-317
Phillip J. Eby
pje@telecommunity.com
Mon, 09 Jun 2003 14:52:18 -0400
At 12:54 PM 6/9/03 -0600, Steven Taschuk wrote:
>Quoth Raymond Hettinger:
> [...]
> > Except for conceptual purity, is there any real payoff in terms
> > of performance or capability that would warrant a wholesale
> > revision of working code?
>
>There's also the question (mentioned in the PEP, albeit
>parenthetically) of how implicit instantiation could work with any
>future plan to allow new-style exceptions.
isinstance(ob,Exception)
issubclass(cls,Exception)
That is, a new-style exception would have to be an instance or subclass of
Exception.
The *real* thing that's broken is the check to see if an exception is a
tuple! isinstance(ob,Exception) should be checked first.
I guess I'm missing why this wouldn't work for new-style exceptions,
provided they are required to subclass Exception (which I thought
everything was going to be required to do eventually).