admin管理员组文章数量:1356442
Problem:
When calling custom string method joj()
(e.g., "hello".joj(2)
), I get either:
TypeError: Expected RTResult, got String
, orAttributeError: '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`
本文标签:
版权声明:本文标题:parsing - 1. **"Implementing custom string method 'joj()' in Python interpreter - RTResult error&qu 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744063216a2584512.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论