def callable_reference(object, callback=None):
    if hasattr(object, 'im_self') and object.im_self is not None:
        return _saferef.BoundMethodWeakref(target=object, on_delete=callback)
    return annotatable_weakref(object, callback)
Return an annotated weak ref, supporting bound instance methods.
dataset/ETHPy150Open jek/flatland/flatland/util/weakrefs.py/callable_reference