Interesting suggestion.
>class Exception :
>
> def __init__(s, exception, where = None) :
> s.exception = exception
> s.where = where
>
> def __str__(s) :
> return s.exception
>
> def someAction(s) :
> ..
>
>...
>
> raise Exception(ZeroDiv, cellRef)
>
>...
>
> try : x() except ZeroDiv :
> sys.exc_type.someAction()
I would imagine that this would work slightly differently. First you
create your generic exception type. E.g.:
MyZeroDiv = Exception(...)
next you would be able to do:
MyZeroDiv.raise(where, ...)
and catch it:
try: x() except MyZeroDiv:
MyZeroDiv.someAction()
-Jaap-