Closed m-novikov closed 5 years ago
Marvelous!
Can we somehow attach the new, filtered operator traceback as a cause to the original one, to be consistent with the usual exception chaining concept?
Can we somehow attach the new, filtered operator traceback as a cause to the original one, to be consistent with the usual exception chaining concept?
Do you mean raise e from <smth>
? In this case, I would like to avoid this, because it requires reraising exception which is inconvenient, to say the least in chained operators (basically one must only raise a custom exception at the end of the operator chain) and doesn't provide nice output
I tried
:+1: LGTM
Added context manager and install/uninstall functions.
Changed implementation a bit.
Now I inspect a self
object to guess the Operator class, instead of looking it up within a module.
Seems like there is no sane way to get function __qualname__
from frame or code object.
https://bugs.python.org/issue13672
https://bugs.python.org/issue12857
:+1:
Added
Operator Stack
section to exceptions see examples here The section includes full operator class name + method and pointer to file:lineno