Skip to content

Commit

Permalink
Go over comments...
Browse files Browse the repository at this point in the history
* Correct and expand comment regarding trace.run_xxx

* And one other comment in trace_fn_call_event
  • Loading branch information
rocky committed Sep 1, 2024
1 parent d5fd429 commit a801896
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
12 changes: 8 additions & 4 deletions mathics/core/builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,21 @@
import os.path as osp
import re
from abc import ABC
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 pkg_resources
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,
Expand Down
7 changes: 4 additions & 3 deletions mathics/core/symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "_#"

Expand Down
2 changes: 1 addition & 1 deletion mathics/eval/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a801896

Please sign in to comment.