This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author t-vi
Recipients Ivan.Pozdeev, t-vi
Date 2018-06-15.19:46:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1529091976.6.0.56676864532.issue33826@psf.upfronthosting.co.za>
In-reply-to
Content
Apologies for not being clear.
So I wrote:

In IPython (or Jupyter), `inspect.getsource` is able to retrieve the source code for functions but not classes.

By this I mean:

import inspect

class X:
  pass

inspect.getsource(X)

Note that:
- it won't work in the vanilla python interpreter,
- it does work for functions in Jupyter/IPython currently,
- it works for classes (and functions) in modules.
What I would like is to have it work for classes in Jupyter/IPython.

By the way: Would a PR be more convenient than a patch?
History
Date User Action Args
2018-06-15 19:46:16t-visetrecipients: + t-vi, Ivan.Pozdeev
2018-06-15 19:46:16t-visetmessageid: <1529091976.6.0.56676864532.issue33826@psf.upfronthosting.co.za>
2018-06-15 19:46:16t-vilinkissue33826 messages
2018-06-15 19:46:16t-vicreate