You are viewing an older version (9.15.0).Go to latest (9.17.0)
{ } Raw JSON

bundles / IPython 9.15.0 / IPython / utils / dir2 / get_real_method

function

IPython.utils.dir2:get_real_method

source: /dev/ipython/IPython/utils/dir2.py:56

Signature

def get_real_method(obj: object, name: str) → Callable[..., Any] | None

Summary

Like getattr, but with a few extra sanity checks:

Extended Summary

  • 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.

Aliases

  • IPython.core.completer.get_real_method