mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-22 21:28:52 +00:00
Add comparison operator to python objects under --gen-compare option (#7610)
* Add comparison operator to python code generator * Missing semi-colon * Regenerate test examples Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
@@ -217,6 +217,19 @@ class MonsterExtraT(object):
|
||||
x._UnPack(monsterExtra)
|
||||
return x
|
||||
|
||||
def __eq__(self, other):
|
||||
return type(self) == type(other) and \
|
||||
self.d0 == other.d0 and \
|
||||
self.d1 == other.d1 and \
|
||||
self.d2 == other.d2 and \
|
||||
self.d3 == other.d3 and \
|
||||
self.f0 == other.f0 and \
|
||||
self.f1 == other.f1 and \
|
||||
self.f2 == other.f2 and \
|
||||
self.f3 == other.f3 and \
|
||||
self.dvec == other.dvec and \
|
||||
self.fvec == other.fvec
|
||||
|
||||
# MonsterExtraT
|
||||
def _UnPack(self, monsterExtra):
|
||||
if monsterExtra is None:
|
||||
|
||||
Reference in New Issue
Block a user