You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just heads up from testing a PR on JupyterLab with "XPython Raw", which fails on representation of pandas.DataFrame class (instances work, classes fail with):
The fix should be for xeus-python-raw to do the same thing as IPython's get_real_method to get the repr method instead of simply checking with has_attr.
defget_real_method(obj, name):
"""Like getattr, but with a few extra sanity checks: - If obj is a class, ignore everything except class methods - Check if obj is a proxy that claims to have all attributes - Catch attribute access failing with any exception - Check that the attribute is a callable object Returns the method or None. """try:
canary=getattr(obj, '_ipython_canary_method_should_not_exist_', None)
exceptException:
returnNoneifcanaryisnotNone:
# It claimed to have an attribute it should never havereturnNonetry:
m=getattr(obj, name, None)
exceptException:
returnNoneifinspect.isclass(obj) andnotisinstance(m, types.MethodType):
returnNoneifcallable(m):
returnmreturnNone
Just heads up from testing a PR on JupyterLab with "XPython Raw", which fails on representation of
pandas.DataFrame
class (instances work, classes fail with):Observed:
Expected (in both IPython and normal XPython):
Sorry about the noise if you already fixed that in the master!
The text was updated successfully, but these errors were encountered: