Muhammad Tauqir Ahmad added the comment:
Yes I understand your change and other possible changes will fix the
reproducer. I am already using a different workaround in my code.
The issue is about `inspect.getsource()` having incorrect behavior (or at least
inaccurate error message) and
New submission from Muhammad Tauqir Ahmad:
If a method `foo` of object instance `obj` is injected into it using a method
from a different object instance, `inspect.getsource(obj.foo)` fails with the
error message:
TypeError: > is
not a module, class, method, function, traceback, frame,