object-oriented programming by defaultinstances of custom classes support operator =(which always returns false)and are hashable (so can be dictionary keys and can be added to setsbut if we reimplement the __eq__(special method to provide proper equality testinginstances are no longer hashable this can be fixed by providing __hash__(special method as we have done here python provides hash functions for stringsnumbersfrozen setsand other classes here we have simply used the built-in hash(function (which can operate on any type which has __hash__(special method)and given it the object' unique id from which to calculate the hash (we can' use the private self __value since that can change as result of augmented assignmentwhereas an object' hash value must never change the built-in id(function returns unique integer for the object it is given as its argument this integer is usually the object' address in memorybut all that we can assume is that no two objects have the same id behind the scenes the is operator uses the id(function to determine whether two object references refer to the same object def __format__(selfformat_spec)return format(self __valueformat_specthe built-in format(function is only really needed in class definitions it takes single object and an optional format specification and returns string with the object suitably formatted fuzzybool usage examples when an object is used in format string the object' __format__(method is called with the object and the format specification as arguments the method returns the instance suitably formatted as we saw earlier all the built-in classes already have suitable __format__(methodshere we make use of the float __format__(method by passing the floating-point value and the format string we have been given we could have achieved exactly the same thing like thisdef __format__(selfformat_spec)return self __value __format__(format_specusing the format(function requires tiny bit less typing and is clearer to read nothing forces us to use the format(function at allso we could invent our own format specification language and interpret it inside the __format__(methodas long as we return string @staticmethod def conjunction(*fuzzies)return fuzzybool(min([float(xfor in fuzzies])