[issue33826] enable discovery of class source code in IPython interactively defined classes

Ivan Pozdeev report at bugs.python.org
Fri Jun 15 15:54:20 EDT 2018


Ivan Pozdeev <ivan_pozdeev at mail.ru> added the comment:

I got that part, thank you.

I can't get 1)what you're expecting as an output and 2)why this should work the way you're suggesting 'cuz functions and classes are very different.

In particular, classes can be modified dynamically, unlike functions. So if you just print out the lines from the file with the definition (which is what getsource() does), it may not be what the interpreter is actually using.

----------

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


More information about the Python-bugs-list mailing list