object(but only to the one controlling objectpattern matching as final trywe can express all the logic more directly using multiple dispatch this should be more readablealbeit there are still number of cases to definefrom multipledispatch import dispatch @dispatch(rockrockdef beats (xy)return none @dispatch(rockpaperdef beats (xy)return @dispatch(rockscissorsdef beats (xy)return @dispatch(paperrockdef beats (xy)return @dispatch(paperpaperdef beats (xy)return none @dispatch(paperscissorsdef beats (xy)return @dispatch(scissorsrockdef beats (xy)return @dispatch(scissorspaperdef beats (xy)return @dispatch(scissorsscissorsdef beats (xy)return none @dispatch(objectobjectdef beats (xy)if not isinstance( (rockpaperscissors))raise typeerror("unknown first thing"elseraise typeerror("unknown second thing"beats (rockpaperbeats (rock typeerrorunknown second thing callables