def _install_generic_equal(cls, attrs):
attrs = attrs.split()<EOL>def __eq__(self, other):<EOL><INDENT>if not isinstance(other, cls):<EOL><INDENT>return False<EOL><DEDENT>for a in attrs:<EOL><INDENT>if not (getattr(self, a) == getattr(other, a)):<EOL><INDENT>return False<EOL><DEDENT><DEDENT>return True<EOL><DEDENT>cls.__eq__ = __eq__<EOL>
Add an __eq__ method to |cls| so objects can be compared for tests.

    Args:
      cls: Python class to add __eq__ method to
      attrs: string - space separated of attribute names to compare