code: def sametype(func):
      
      @functools.wraps(func)
      def wrapper(self, other):  # pylint: disable=missing-docstring
          if type(other) is not type(self):
              return NotImplemented
          return func(self, other)
      return wrapper
docs: Method decorator to return ``NotImplemented`` if the args of the wrapped
      method are of different types.
  
      When wrapping a rich model comparison method this will delegate (reflect)
      the comparison to the right-hand-side object, or fallback by passing it up
      the inheritance tree.