Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getsource and getsourcelines in the inspect module #41409

Closed
sonderblade mannequin opened this issue Jan 7, 2005 · 2 comments
Closed

getsource and getsourcelines in the inspect module #41409

sonderblade mannequin opened this issue Jan 7, 2005 · 2 comments
Labels
stdlib Python modules in the Lib dir

Comments

@sonderblade
Copy link
Mannequin

sonderblade mannequin commented Jan 7, 2005

BPO 1098134

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2005-01-08.11:09:45.000>
created_at = <Date 2005-01-07.20:28:46.000>
labels = ['library']
title = 'getsource and getsourcelines in the inspect module'
updated_at = <Date 2005-01-08.11:09:45.000>
user = 'https://bugs.python.org/sonderblade'

bugs.python.org fields:

activity = <Date 2005-01-08.11:09:45.000>
actor = 'jlgijsbers'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2005-01-07.20:28:46.000>
creator = 'sonderblade'
dependencies = []
files = []
hgrepos = []
issue_num = 1098134
keywords = []
message_count = 2.0
messages = ['23886', '23887']
nosy_count = 2.0
nosy_names = ['jlgijsbers', 'sonderblade']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1098134'
versions = ['Python 2.3']

@sonderblade
Copy link
Mannequin Author

sonderblade mannequin commented Jan 7, 2005

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.

@sonderblade sonderblade mannequin closed this as completed Jan 7, 2005
@sonderblade sonderblade mannequin added the stdlib Python modules in the Lib dir label Jan 7, 2005
@sonderblade sonderblade mannequin closed this as completed Jan 7, 2005
@sonderblade sonderblade mannequin added the stdlib Python modules in the Lib dir label Jan 7, 2005
@jlgijsbers
Copy link
Mannequin

jlgijsbers mannequin commented Jan 8, 2005

Logged In: YES
user_id=469548

This is fixed in Python 2.5 and the upcoming 2.4.1 by patch
1011890. Thanks for the report, though.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

0 participants