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.

Home Page:https://mathics.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exception in comparison

mmatera opened this issue · comments

Description

Wo["x"]>0 raises an exception:

File "mathics-core/mathics/builtin/testing_expressions/equality_inequality.py", line 94, in eval
    c = do_cmp(x, y)
  File "mathics-core/mathics/eval/testing_expressions.py", line 32, in do_cmp
    if s1.is_Float and s2.is_Float:
AttributeError: 'NoneType' object has no attribute 'is_Float'

This seems to happen only if one of the arguments is a String. For example,

  • Wo[3]>0
  • Wo[f[x]]>0

stays unevaluated, but

  • Wo[3, "x"]>0
  • Wo[f["x"]]>0

raise the exception.