Message329203
Thanks Serhiy for the details. I think there are also less tests for inspect.findsource with respect to classes though it's more robust than the regex approach. Thus there might be different effects which are correct now or selects an alternate candidate as you have mentioned. I think this is worth adding a test case once the behavior is finalized.
On a general note I am curious is there any patch to add line number directly to the class as an attribute? I think inspect module uses object.co_firstlineno where object is a code object and works for function object. Is there any technical difficulty in this? I searched the mailing list and PEPs but couldn't come across anything. Also there are couple of issues around showing source from REPL where it's not saved to the file issue33826, issue12920.
There is one more frame pointer issue that is not working with class objects with a PR that fixes some more issues in findsource with respect to classes : issue35101.
Thanks |
|
Date |
User |
Action |
Args |
2018-11-03 18:53:35 | xtreak | set | recipients:
+ xtreak, serhiy.storchaka, yselivanov, pablogsal, Windson Yang |
2018-11-03 18:53:35 | xtreak | set | messageid: <1541271215.04.0.788709270274.issue35113@psf.upfronthosting.co.za> |
2018-11-03 18:53:35 | xtreak | link | issue35113 messages |
2018-11-03 18:53:34 | xtreak | create | |
|