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

What is sset_trace? #286

Closed
galenseilis opened this issue Oct 16, 2024 · 2 comments
Closed

What is sset_trace? #286

galenseilis opened this issue Oct 16, 2024 · 2 comments

Comments

@galenseilis
Copy link

galenseilis commented Oct 16, 2024

On the README I see this example:

import ipdb
ipdb.sset_trace()
ipdb.spm()

from ipdb import slaunch_ipdb_on_exception
with slaunch_ipdb_on_exception():
    ...

At first I thought that sset_trace, but when I ran it in an interactive Python session I found that it appeared to start a trace... but I am not clear about why that worked or why it exists as an alternative to set_trace.

What is sset_trace? How does it differ from set_trace?

@disconnect3d
Copy link

It is documented here - https://pypi.org/project/ipdb/:
image

You can also check the code yourself:

ipdb/ipdb/stdout.py

Lines 9 to 18 in 400e37c

def update_stdout():
# setup stdout to ensure output is available with nose
io.stdout = sys.stdout = sys.__stdout__
def sset_trace(frame=None, context=3):
update_stdout()
if frame is None:
frame = sys._getframe().f_back
set_trace(frame, context)
;)

@galenseilis
Copy link
Author

@disconnect3d Thanks!

(Also, nice Warcraft III profile picture. I recall getting Warcraft III when it first came out. Fond memories of playing it.)

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

No branches or pull requests

2 participants