First time here? Check out the FAQ!

Ask Your Question
0

set_trace() analog for Sage

asked 3 years ago

petRUShka gravatar image

In sage one can use import pdb;pdb.set_trace() or in case of tests: import pytest; pytest.set_trace(). But these commands invoke pure python console without Sage improvements.

Are there something like sage.set_trace() command which opens Sage REPL instead if Python REPL?

Preview: (hide)

Comments

Did you try import pdb;pdb.set_trace()in a Sage terminal ?

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 3 years ago )

It's no use I think. Good to have pdb when you run file like sage file.sage. But I tried and it is standard pdb without any Sage features.

petRUShka gravatar imagepetRUShka ( 3 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 3 years ago

tkarn gravatar image

updated 3 years ago

If you are using Sage in the terminal, you can simply type pdb and it will turn on the debugger when an error is raised. This does not quite answer your question, but might help a bit.

sage: pdb
Automatic pdb calling has been turned ON

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 3 years ago

Seen: 243 times

Last updated: Jul 17 '21