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
Metadata
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| trepan3k_mathics3-1.1.0.tar.gz | 22.0 kB | Without provenance | Details for trepan3k_mathics3-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| trepan3k_mathics3-1.1.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for trepan3k_mathics3-1.1.0-py2.py3-none-any.whl |
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
|
Security for trepan3k-mathics3 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.