| Index: gclient_utils.py
|
| diff --git a/gclient_utils.py b/gclient_utils.py
|
| index 0d5714acc00ac5f67407f6ff30dd46c37cc8fabb..5fd794519630b4f4eff548d59d2bb8c03d354948 100644
|
| --- a/gclient_utils.py
|
| +++ b/gclient_utils.py
|
| @@ -901,3 +901,16 @@ def NumLocalCpus():
|
| # Mac OS 10.6 only
|
| # pylint: disable=E1101
|
| return int(os.sysconf('SC_NPROCESSORS_ONLN'))
|
| +
|
| +
|
| +class BaseRecord(object):
|
| + """Base class for objects with equality by value."""
|
| + @property
|
| + def __key__(self):
|
| + return (self.__class__, tuple(self.__dict__.iteritems()))
|
| +
|
| + def __eq__(self, other):
|
| + return self.__key__ == getattr(other, '__key__', None)
|
| +
|
| + def __hash__(self):
|
| + return hash(self.__key__)
|
|
|