我有两个班的情况:类型错误在Python
testing.py:
class Functions:
def mapping(func, x):
return func(x)
,我尝试运行下面的代码:经过我尝试运行
import testing
def doubleMe(data):
return data * data
res = stream.Functions.map(testdouble, [1,2,3,4,5])
print res
代码,我得到了错误
TypeError: unbound method mapping() must be called with Functions instance as first argument (got function instance instead)
我没有非常确定这里出了什么问题,我可以提供一些建议吗?谢谢!
谢谢米莎!这有帮助! – shh