flatbuffers icon indicating copy to clipboard operation
flatbuffers copied to clipboard

[Python] Missing comparison operator in python object API with --gen-object-api --gen-compare options

Open Alex-Ratcliffe opened this issue 3 years ago • 0 comments

There is no implementation of the comparison operator in the python generated object API. This will result in unexpected behavior when comparing objects which should be equal, but result in a False output under == as they differ by function members. This can be fixed by adding the eq function to objects generated for the API which check for equality between the fields.

The change is relatively simple, and I have an implementation working. I will create a PR for this if there are no in principle problems.

Alex-Ratcliffe avatar Oct 21 '22 19:10 Alex-Ratcliffe