@classdef.method("rindex", end="int")
    def method_rindex(self, space, w_sub, end=0):
        if end < 0:
            end += self.length()
        else:
            end = self.length()
        if end < 0:
            return space.w_nil

        idx = -1
        if space.is_kind_of(w_sub, space.w_string):
            idx = space.str_w(self).rfind(space.str_w(w_sub), 0, end + 1)
        elif space.is_kind_of(w_sub, space.w_regexp):
            ctx = w_sub.make_ctx(space.str_w(self))
            idx = -1
            while self.search_context(space, ctx):
                if ctx.match_start > end:
                    break
                else:
                    idx = ctx.match_start
                ctx.reset(idx + 1)
        else:
            raise space.error(
                space.w_TypeError,
                "type mismatch: %s given" % space.obj_to_s(space.getclass(w_sub))
            )
        if 0 < idx:
            return space.w_nil
        else:
            return space.newint(idx)
dataset/ETHPy150Open topazproject/topaz/topaz/objects/stringobject.py/W_StringObject.method_rindex/swapped operands of `<`