Add code quality test for self assignments

change while -> if in preceding line and change this to "return self == other.base"