Skip to content

Commit 19e9abb

Browse files
Implement Breakpoint[]
1 parent d1cf6a4 commit 19e9abb

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

mathics/builtin/system.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,3 +871,28 @@ def eval_with_symbol(self, symbol, evaluation: Evaluation) -> Integer:
871871
else:
872872
gc.collect()
873873
return Integer0
874+
875+
876+
class Breakpoint(Builtin):
877+
"""
878+
<dl>
879+
<dt>'Breakpoint[]'
880+
<dd> Invoke a Python breakpoint. By default, the python debugger \
881+
(pdb) is loaded. For loading other debuggers, the Python environment \
882+
variable `PYTHONBREAKPOINT` can be utilized.
883+
</dl>
884+
885+
>> Breakpoint[]
886+
--Return--
887+
> mathics/builtin/system.py(891)eval()->None
888+
-> breakpoint()
889+
(Pdb) c
890+
Out[1]= Breakpoint[]
891+
"""
892+
893+
summary_text = "invoke a Python breakpoint"
894+
895+
def eval(self, evaluation: Evaluation):
896+
"Breakpoint[]"
897+
898+
breakpoint()

0 commit comments

Comments
 (0)