diff --git a/mathics/core/builtin.py b/mathics/core/builtin.py index e493c9281..ed5206c70 100644 --- a/mathics/core/builtin.py +++ b/mathics/core/builtin.py @@ -8,16 +8,20 @@ import importlib import re -from functools import lru_cache, total_ordering +from functools import total_ordering from itertools import chain from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union, cast import mpmath import sympy -# Note: it is important *not* use: from mathics.eval.tracing import run_sympy -# but instead import the module and access below as tracing.run_sympy. -# This allows us change where tracing.run_sympy points at runtime. +# Note: it is important *not* to use: +# from mathics.eval.tracing import run_sympy +# but, instead, import the module, as below, and then +# access ``run_sympy`` using ``tracing.run_sympy.`` +# +# This allows us to change where ``tracing.run_sympy`` points to at +# run time. import mathics.eval.tracing as tracing from mathics.core.atoms import ( Integer, diff --git a/mathics/core/symbols.py b/mathics/core/symbols.py index b01b7bc61..193231d3b 100644 --- a/mathics/core/symbols.py +++ b/mathics/core/symbols.py @@ -14,9 +14,10 @@ # I put this constants here instead of inside `mathics.core.convert.sympy` # to avoid a circular reference. Maybe they should be in its own module. -# Prefix used for Sympy variables. -# We wan t this to be short to keep variable names short. -# In tracing values, long names make output messy. +# Prefix used for Sympy variables. We want prefixes to be short to +# keep variable names short. In tracing values, long names makes +# output messy and harder to follow, since it detracts from the +# important information sympy_symbol_prefix = "_u" sympy_slot_prefix = "_#" diff --git a/mathics/eval/tracing.py b/mathics/eval/tracing.py index e1716bb40..7dc2d6907 100644 --- a/mathics/eval/tracing.py +++ b/mathics/eval/tracing.py @@ -18,7 +18,7 @@ def trace_fn_call_event(func: Callable) -> Callable: """ - Wrap a a call event with callbacks + Wrap a call event with callbacks, so we can track what happened before the call and the result returned by the call.