Leaklens

sympy__sympy-18532

expr.atoms() should return objects with no args instead of subclasses of Atom

Verdict: the fix is stated in the issue (Tier A).

The issue is that the `atoms()` method currently uses `x.is_Atom` to check for "atomic" expressions (expressions with no subexpressions), but it really should be checking `not x.args`. It should be a simple one-line fix to the `atoms` function definition, but a new test should be added, and the full test suite run to make sure it doesn't break anything (`./bin/test` from the sympy directory).

The text states the fix: “The issue is that the `atoms()` method currently uses `x.is_Atom` to check for "atomic" expressions (expressions with no subexpressions), but it really should be checkin…”

All SWE-bench Lite tasks · more sympy/sympy tasks · How the check works