nikitakit added the comment:

I just ran into this issue trying to introspect an IPython session, in which 
case the __main__ module doesn't have a file associated with it.

But it turns out that methods defined in a class do have source code associated 
with them, so it's possible to add a workaround for the common case where a 
class actually has methods.

Code: https://gist.github.com/nikitakit/642cb96febdf2f812d0b

----------
nosy: +nikitakit

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12920>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to