Mathics3 / mathics-core

An open-source Mathematica. This repository contains the Python modules for WL Built-in functions, variables, core primitives, e.g. Symbol, a parser to create Expressions, and an evaluator to execute them.
https://mathics.org
Other
786 stars 48 forks source link

SameQ[] and Expression module tweaks #1079

Closed rocky closed 3 months ago

rocky commented 3 months ago

@mmatera looked the code over and do not find anything wrong with it.

I made some small changes to the docstring comment and addressed some of the lint errors my editor is telling me about.

We can't use generators here since there we access and then "rewind" sometimes. And this is essentially a version without the tail recursions. So I've removed the comments concerning doubt.

If you have the example that caused the failure on 3.12 without this change, it would be interesting to benchmark just this test inside a Mathics3 session to see if there's any difference in execution time.

Other comments I'll put in the specific code changes in this PR.