[issue19956] inspect.getsource(obj.foo) fails when foo is an injected method constructed from another method

2015-04-14 Thread Usman Ehtesham Gul
Usman Ehtesham Gul added the comment: Made changes based on David Murray's review comments including adding unit test on getfile. -- Added file: http://bugs.python.org/file39022/issue_19956_1.patch ___ Python tracker <http://bugs.py

[issue19956] inspect.getsource(obj.foo) fails when foo is an injected method constructed from another method

2015-04-13 Thread Usman Ehtesham Gul
Usman Ehtesham Gul added the comment: After discussing with Eric Snow, this case scenario is an edge case. The assumption in the inspect module is that __func__ for a MethodType object is a function. The MethodType should be used for functions and not methods. Patch attached for this. This