[ python-Bugs-1098134 ] getsource and getsourcelines in the inspect module

SourceForge.net noreply at sourceforge.net
Fri Jan 7 21:28:50 CET 2005


Bugs item #1098134, was opened at 2005-01-07 21:28
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1098134&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Björn Lindqvist (sonderblade)
Assigned to: Nobody/Anonymous (nobody)
Summary: getsource and getsourcelines in the inspect module

Initial Comment:
import inspect

class Hi:
    def oneliner1(): pass
    def oneliner2(): pass

h = Hi()
print inspect.getsourcelines(h.oneliner1)
print "+++" + inspect.getsource(h.oneliner1) + "+++"

Tested on Python 2.3.4. Both the getsource* functions
takes the body of onliner1() and oneliner2() in the call.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1098134&group_id=5470


More information about the Python-bugs-list mailing list