ast.compare
fails if fields or attributes are missing at runtime
#121210
Labels
type-bug
An unexpected behavior, bug, or error
Bug report
Bug description:
ast.compare
does not handle the case where attributes or fields are missing at runtime:I suggest making
ast.compare
ignore a field/attribute if it's missing on both operands (they do compare equal in the sense that they don't have that specific field; not that even without that assumption, we still have an issue withast.compare(ast.Name('a'), ast.Name('a'), compare_attributes=True)
).CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
ast.compare
#121211The text was updated successfully, but these errors were encountered: