[issue35113] inspect.getsource returns incorrect source for classes when class definition is part of multiline strings

Serhiy Storchaka report at bugs.python.org
Sat Nov 3 15:11:55 EDT 2018


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

As for the line number for class, I have not heard anything about this. I think there is no large technical difficulty, but there is a little need. The first line number of the code object is needed first at all for tracing and debugging. Function has attached code object for executing, thus the line number is available for function. But the code object that creates a class is no longer needed after the class is created. Attaching the line number to the class looks like attaching the line number of the "[]" expression to the list created by it.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35113>
_______________________________________


More information about the Python-bugs-list mailing list