Something that would have been useful for me today on the Enum class.
I tried overriding __eq__ but that resulted in recursion errors, I
have no idea why so I just renamed the function.


def isEquivalent(self, other):
        try:
            if self is other:
                return True
            elif len(self) == len(other):
                v = [v.index for v in self.values()]
                oV = [o.index for o in other.values()]
                if oV != v:
                    return False
                if self.keys() != other.keys():
                    return False
                return True
            else:
                return False
        except StandardError, Err:
            print Err
            return False

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to