Query module DefineEqualsWhenAddingAttributes

name
eq not overridden when adding attributes
description
When adding new attributes to instances of a class, equality for that class needs to be defined.
kind
problem
tags
reliability correctness
problem.severity
warning
sub-severity
high
precision
high
id
py/missing-equals

Imports

Equality
SelfAttribute

Utilities to support queries about instance attribute accesses of the form self.attr.

python

Predicates

class_stores_to_attribute
should_override_eq
superclassEqExpectsAttribute

Does the non-overridden eq method access the attribute, which implies that the eq method does not need to be overridden.