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

sys.settrace - document 'some other code blocks' for 'call' event type #57440

Open
techtonik mannequin opened this issue Oct 20, 2011 · 3 comments
Open

sys.settrace - document 'some other code blocks' for 'call' event type #57440

techtonik mannequin opened this issue Oct 20, 2011 · 3 comments
Labels
docs Documentation in the Doc dir

Comments

@techtonik
Copy link
Mannequin

techtonik mannequin commented Oct 20, 2011

BPO 13231

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 = None
created_at = <Date 2011-10-20.07:40:20.882>
labels = ['docs']
title = "sys.settrace - document 'some other code blocks' for 'call' event type"
updated_at = <Date 2019-03-16.00:09:20.416>
user = 'https://bugs.python.org/techtonik'

bugs.python.org fields:

activity = <Date 2019-03-16.00:09:20.416>
actor = 'BreamoreBoy'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2011-10-20.07:40:20.882>
creator = 'techtonik'
dependencies = []
files = []
hgrepos = []
issue_num = 13231
keywords = []
message_count = 2.0
messages = ['146009', '221972']
nosy_count = 2.0
nosy_names = ['techtonik', 'docs@python']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue13231'
versions = []

@techtonik
Copy link
Mannequin Author

techtonik mannequin commented Oct 20, 2011

http://docs.python.org/library/sys.html#sys.settrace

While writing settrace function you need to know what kind of data is expected and how to get more information about it. Current documentation for sys.settrace doesn't give too much answers. To improve that situation at least with 'call' event:

  1. Link 'frame' to the middle of table on inspect module page [1]

  2. List all possible 'code blocks' for 'call' event (I know there is module in addition to function)

  3. Provide example how to extract popular data for corresponding 'code block' (name for functions, name for modules, name for classes/methods, relative file path, line no, how to detect labmbda function) in a safe manner (inspect page contains some FUD about memory usage)

  4. http://docs.python.org/library/inspect#types-and-members

@techtonik techtonik mannequin assigned docspython Oct 20, 2011
@techtonik techtonik mannequin added the docs Documentation in the Doc dir label Oct 20, 2011
@BreamoreBoy
Copy link
Mannequin

BreamoreBoy mannequin commented Jun 30, 2014

I find this request excessive. The first sentence for sys.settrace states "Set the system’s trace function, which allows you to implement a Python source code debugger in Python". I suspect that anyone wanting to write a debugger would know the Python and its documentation better than the back of their hand. So I say close as "won't fix" but I wouldn't argue if anyone disagreed and wanted to provide a patch.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@acbart
Copy link

acbart commented Aug 19, 2022

I can't say that I know documentation better than the back of my hand, but I am writing a tracing tool right now. I've dug around in the depths of Python's codebase before, but documentation exists so that I don't have to break my back looking over a dozen other pages. I would have greatly appreciated more information about the possible code blocks for call, and it would have been tremendously helpful to have information about how to determine what kind of code block is currently being executed. As it stands, I need to differentiate between a class definition being executed and a function definition being executed, and I see nothing in the docs or my experiments that can help me. It seems to me that the settrace docs could benefit from being expanded a little?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

1 participant