We have specialized objects for certain compound expressions. ListExpression is one, I think Association and Rule may be others. Maybe Pattern in the future as well.
Either the code needs to always do the right thing, e.g. not ever create an Expression(SymbolList, ...) or the Expression() needs to detect specializations.
And after this is done we should replace expr.has_form(custom-expression-form, None) with isinstance(expr, custom-expression-form)
We have specialized objects for certain compound expressions.
ListExpressionis one, I thinkAssociationandRulemay be others. MaybePatternin the future as well.Either the code needs to always do the right thing, e.g. not ever create an
Expression(SymbolList, ...)or theExpression()needs to detect specializations.And after this is done we should replace
expr.has_form(custom-expression-form, None)withisinstance(expr, custom-expression-form)