objprint
objprint copied to clipboard
`arg_name=True` not usable in Jupyter & IPython
from objprint import op
def func():
return 1
cc = op(func(), arg_name=True)
maybe it's because here: https://github.com/gaogaotiantian/objprint/blob/7920c8601e86e97fe05a807d820121bac00471b7/src/objprint/frame_analyzer.py#L55-L58
module is None for Jupyter & IPython, but they have file:
jupyter:
ipython:
and source can be retrieved with:
Change to source = inspect.getsource(frame)
will work: