[python] Compare object instances for equality by their attributes