r = Repository('.git')
r['103ea4507a9df26a19388cd4115c8bfd1fb784af'] == r['103ea4507a9df26a19388cd4115c8bfd1fb784af']
I'd like to add a __eq__ method to Object which compares the underlying Oid object held by the id attribute.
Additionally, since this this attribute is read-only Objects are effectively immutable, thus it would be great to have a __hash__ method (which returns hash(self.id)) so that Objects can be placed in sets and used as keys in dictionaries.
I'm happy to make the PR for this if you think it makes sense.
It would be intuitive if this worked:
I'd like to add a
__eq__
method toObject
which compares the underlyingOid
object held by theid
attribute.Additionally, since this this attribute is read-only
Objects
are effectively immutable, thus it would be great to have a__hash__
method (which returnshash(self.id)
) so thatObjects
can be placed in sets and used as keys in dictionaries.I'm happy to make the PR for this if you think it makes sense.