pyorient
pyorient copied to clipboard
OrientRecord - __eq__(), __cmp__() and __hash__() methods
It would be nice if the OrientRecord class had __eq__()
, __cmp__()
and __hash__()
methods so that we can check for the existence of a RID in a list of OrientRecords.
if '#12:0' in records:
print('Got here')
Thoughts?
Would also be pretty useful to have __contains__
and a lot of the other container methods. That way we can do things like check for a field in a record.
if 'test_field' in record:
print(record.test_field)
Yo, in some recent develop branch commits, I've added various container methods to OrientRecord.
Left out the various ordering operations suggested across python 2/3 ... not convinced there's meaningful ordering for records.