[issue40317] inspect.getsource() examines incorrect target

2020-04-28 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: yes, thanks Ammar. Thanks Grzegorz for the report. -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> inspect.getsource returns incorrect source for classes when class definition is part of multiline stri

[issue40317] inspect.getsource() examines incorrect target

2020-04-28 Thread Ammar Askar
Ammar Askar added the comment: Did you mean to close this Karthik? -- nosy: +ammar2 ___ Python tracker ___ ___ Python-bugs-list mai

[issue40317] inspect.getsource() examines incorrect target

2020-04-18 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Fixed in master now with https://github.com/python/cpython/commit/696136b993e11b37c4f34d729a0375e5ad544ade . This includes the change of show decorators for classes too to make it consistent with functions so it's not backported. -- _

[issue40317] inspect.getsource() examines incorrect target

2020-04-18 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: This will be resolved hopefully resolved using https://github.com/python/cpython/pull/10307 . Using my patch on the reproducer in the report. ./python bpo40317.py 123 class Number: payload = 123 321 class Number: payload =

[issue40317] inspect.getsource() examines incorrect target

2020-04-18 Thread Grzegorz Krasoń
New submission from Grzegorz Krasoń : Based on the attached example: Expected output: ``` 123 class Number: payload = 123 321 class Number: payload = 321 ``` Actual output: ``` 123 class Number: payload = 123 321 class Number: payload = 123 ```