single-cell-data / SOMA

A flexible and extensible API for annotated 2D matrix data stored in multiple underlying formats.
MIT License
69 stars 9 forks source link

Explicitly use object-identity–based equality for SOMA objects #108

Closed thetorpedodog closed 1 year ago

thetorpedodog commented 1 year ago

When inheriting from a type that defines an __eq__ operation, that __eq__ will override the built-in __eq__. In the case of the MutableMapping type, that means that it will try to use element-wise comparison against any other mapping type. This is effectively an attractive nuisance. Instead, we explicitly use the default comparison, which is based on object identity rather than contents or anything.