object-oriented programming directly as though they were floats we have omitted the or versions since they differ only in their names (__or__(and __ior__()and that they use max(rather than min(def __repr__(self)return ("{ }({ })format(self __class__ __name__super(__repr__())we must reimplement the __repr__(method since the base class version float __repr__(just returns the number as stringwhereas we need the class name to make the representation eval()-able for the str format()' second argument we cannot just pass self since that will result in an infinite recursion of calls to this __repr__(methodso instead we call the base class implementation we don' have to reimplement the __str__(method because the base class versionfloat __str__()is sufficient and will be used in the absence of fuzzybool __str__(reimplementation def __bool__(self)return self def __int__(self)return round(selfwhen float is used in boolean context it is false if its value is and true otherwise this is not the appropriate behavior for fuzzyboolsso we have had to reimplement this method similarlyusing int(selfwould simply truncateturning everything but into so here we use round(to produce for values up to and for values up to and including the maximum of we have not reimplemented the __hash__(methodthe __format__(methodor any of the methods that are used to provide the comparison operatorssince all those provided by the float base class work correctly for fuzzybools the methods we have reimplemented provide complete implementation of the fuzzybool class--and have required far less code than the implementation presented in the previous subsubsection howeverthis new fuzzybool class has inherited more than methods which don' make sense for fuzzybools for examplenone of the basic numeric and bitwise shift operators (+-*/<<>>etc can sensibly be applied to fuzzybools here is how we could begin to "unimplementadditiondef __add__(selfother)raise notimplementederror(we would also have to write the same code for the __iadd__(and __radd__(methods to completely prevent addition (note that notimplementederror is standard exception and is different from the built-in notimplemented object an