pointless recursive calls to simplify their valuesand extra constructor calls build resultsz with isinstance test commented-out print(zprint( print( zprint( to testthe rest of commuter py looks and runs like this--classes can appear in tuples naturally#!python from __future__ import print_function classes defined here / compatibility if __name__ ='__main__'for klass in (commuter commuter commuter commuter commuter )print('- klass( klass( print( print( yprint( yc:\codecommuter py add radd add radd etc there are too many coding variations to explore hereso experiment with these classes on your own for more insightaliasing __radd__ to __add__ in commuter for examplesaves linebut doesn' prevent object nesting without isinstance see also python' manuals for discussion of other options in this domainfor exampleclasses may also return the special notimplemented object for unsupported operands to influence method selection (this is treated as though the method were not definedin-place addition to also implement +in-place augmented additioncode either an __iadd__ or an __add__ the latter is used if the former is absent in factthe prior section' commuter operator overloading