admin管理员组

文章数量:1356442

Problem:
When calling custom string method joj() (e.g., "hello".joj(2)), I get either:

  1. TypeError: Expected RTResult, got String, or
  2. AttributeError: 'function' object has no attribute 'arg_names'

Traceback (most recent call last):

File "interpreter.py", line X, in execute

res.register(value_to_call.execute(args))

AttributeError: 'function' object has no attribute 'arg_names'

Relevant Code:

# String class implementation
def joj(self, index):
    res = RTResult()
    if not isinstance(index, Number):
        return res.failure(...)
    return res.success(String(self.value[index]))


[download my project language blopy](.zip)


bsay("hello me".joj(4)) # o

`but error`

本文标签: