Skip to content

Mathics crash running MatchQ[0 + x, ( a_. + b_. ) ] #1173

@rocky

Description

@rocky

Description

MatchQ[0 + x, ( a_. + b_. ) ]

produces a Python traceback.

How to Reproduce

$ mathics
In[1]:=  MatchQ[0 + x, ( a_. + b_. ) ]
Traceback (most recent call last):
  File "/home/rocky/.pyenv/versions/3.12.7/bin/mathics", line 33, in <module>
    sys.exit(load_entry_point('Mathics3', 'console_scripts', 'mathics')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expected behavior

No crash. For the example given, True is expected.

Additional context

This was encountered in working on getting Rubi running. See also https://github.com/Mathics3/mathics-core/discussions/1168#discussioncomment-11298819

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions