def __eq__(self, other):
        """
        Test for equality with ``other``.

        if ``other`` is a regular mapping/dict, compare only order-insensitive keys/values.
        if ``other`` is also a OrderedDict, also compare the order of keys.
        if ``other`` is also a MIDict, also compare the index names.

        """
        if not isinstance(other, Mapping):
            return NotImplemented

        is_MIMapping = isinstance(other, MIMapping)
        if not is_MIMapping: # assuming other is a normal 2-index mapping
            if len(self.indices) not in [0,2]:
                return False # indices not equal

        eq = super(MIMapping, self).__eq__(other)

        if not eq:
            return False

        if is_MIMapping:
            eq = force_list(self.indices.keys()) == force_list(other.indices.keys())

        return eq
def __eq__ ( self , other ) : if not isinstance ( other , Mapping ) : return NotImplemented is_MIMapping = isinstance ( other , MIMapping ) if not is_MIMapping : if len ( self . indices ) not in [ 0 , 2 ] : return False eq = super ( MIMapping , self ) . __eq__ ( other ) if not eq : return False if is_MIMapping : eq = force_list ( self . indices . keys ( ) ) == force_list ( other . indices . keys ( ) ) return eq
Test for equality with ``other``.

        if ``other`` is a regular mapping/dict, compare only order-insensitive keys/values.
        if ``other`` is also a OrderedDict, also compare the order of keys.
        if ``other`` is also a MIDict, also compare the index names.