the built-in behavior here is the code that is generated for the first tuple ("__xor__""^")def __xor__(self*args)types ["'arg __class__ __name__ "'for arg in argsraise typeerror("unsupported operand type(sfor ^"'{self}'{join{args}formatself=self __class__ __name__join=(andif len(args= else ",")args="join(types))the two for in loop blocks we have used here can be simply cut and pastedand then we can add or remove unary operators and methods from the first one and binary or -ary operators and methods from the second one to unimplement whatever methods are not required with this last piece of code in placeif we had two fuzzyboolsf and gand tried to add them using gwe would get typeerror exception with the message "unsupported operand type(sfor +'fuzzybooland 'fuzzybool'"which is exactly the behavior we want creating classes the way we did for the first fuzzybool implementation is much more common and is sufficient for almost every purpose howeverif we need to create an immutable classthe way to do it is to reimplement object __new__(having inherited one of python' immutable types such as floatintstror tupleand then implement all the other methods we need the disadvantage of doing this is that we may need to unimplement some methods--this breaks polymorphismso in most cases using aggregation as we did in the first fuzzybool implementation is much better approach custom collection classes ||in this section' subsections we will look at custom classes that are responsible for large amounts of data the first class we will reviewimageis one that holds image data this class is typical of many data-holding custom classes in that it not only provides in-memory access to its databut also has methods for saving and loading the data to and from disk the second and third classes we will studysortedlist and sorteddictare designed to fill rare and surprising gap in python' standard library for intrinsically sorted collection data types creating classes that aggregate collections | simple way of representing color image is as two-dimensional array with each array element being color so to represent image we must store colors for the image class (in file image py)we will take