Skip to main content

Abstract

Here, we have a module extension for the trepan3k debugger that adds commands that largely filter out and interpret Python information into a more Mathics3-centric information.

Install

$ pip install -e .

Example

$ mathics3 --post-mortem  # goes into trepan3k post-mortem debugger on error.
In[1]:= (* Put something here that that triggers a bug in Mathics3 *)
Traceback (most recent call last):
  File "/tmp/Mathics3/mathics-core/mathics/core/expression.py", line 1907, in _is_neutral_symbol
    definition = definitions.get_definition(symbol_name, only_if_exists=True)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/src/external-vcs/github/Mathics3/mathics-core/mathics/core/definitions.py", line 506, in get_definition
    raise KeyError
KeyError
(Trepan3k:pm) load trepan3k_mathics3
loaded command: "mathics3"
loaded command: "mbacktrace"
loaded command: "mdown"
loaded command: "mup"
loaded command: "printelement"
(Trepan3k:pm) (Trepan3k:pm) help mbacktrace
mbacktrace [options] [count]

    Print backtrace of all stack frames, or innermost count frames.


    An arrow indicates the 'current frame'. The current frame determines
    the context used for many debugger commands such as expression
    evaluation or source-line listing.


    options are:


       -h | --help    - give this help
       -b | --builtin - show Mathics3 builtin methods
       -e | --expr    - show Mathics3 Expressions


    Examples:
    ---------


       mbacktrace      # Print a full stack trace
       mbacktrace 2    # Print only the top two entries





Aliases: mbt.

(Trepan3k:pm) mbacktrace -e
E:0 (3) Expression.restructure <class 'mathics.core.expression.Expression'>
         restructure(reparseUnterminatedGroupNode[{args}, bytes, FilterRules[{Sequence[]}, Options[reparseUnterminatedGro...),
     head=<Symbol: CodeParser`Private`reparseUnterminatedGroupNode>, elements=[<Expression: <SymbolConsta...)
     called from file '/tmp/Mathics3/mathics-core/mathics/core/expression.py' at line 1138
E:1 (4) Expression._flatten_sequence <class 'mathics.core.expression.Expression'>
         _flatten_sequence(reparseUnterminatedGroupNode[{args}, bytes, FilterRules[{Sequence[]}, Options[reparseUnterminatedGro...),
     sequence=<function Expression.flatten_pattern_sequence.<locals>.sequence at 0x77d671362ac0>, evaluat...)
     called from file '/tmp/Mathics3/mathics-core/mathics/core/expression.py' at line 418
E:2 (5) Expression.flatten_pattern_sequence <class 'mathics.core.expression.Expression'>
         flatten_pattern_sequence(reparseUnterminatedGroupNode[{args}, bytes, FilterRules[{Sequence[]}, Options[reparseUnterminatedGro...),
     evaluation=<mathics.core.evaluation.Evaluation object at 0x77d671c18f50>)
     called from file '/tmp/Mathics3/mathics-core/mathics/core/expression.py' at line 644

Release files for trepan3k-mathics3 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trepan3k-mathics3 1.1.0
File Size Uploaded
trepan3k_mathics3-1.1.0.tar.gz 22.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for trepan3k-mathics3 1.1.0
File Interpreter ABI Platform
trepan3k_mathics3-1.1.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 47.6 kB

Release files / trepan3k_mathics3-1.1.0.tar.gz

Download URL trepan3k_mathics3-1.1.0.tar.gz
Size 22.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9e190c334f0c518ec39486b2007e90a99fd52317dcf8d9ed8a9c4ea13ae266d8
BLAKE2b-256 checksum
How to use checksums
b8fbe67051915d9eb73c93293b9de67600ff09921212e083527bf46c62e6154b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / trepan3k_mathics3-1.1.0-py2.py3-none-any.whl

Download URL trepan3k_mathics3-1.1.0-py2.py3-none-any.whl
Size 25.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
b11c7b202407a681f6a45fa735c1839d68a54071bdbe53e0ca70fce20ecc87df
BLAKE2b-256 checksum
How to use checksums
88d6e0a6576756aaf3e9230371057289c3bb1c80da930ea31cd832f6e977515d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page