![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
调试
芦边湖泊
这个作者很懒,什么都没留下…
展开
-
__call__用法
__call__方法的功能类似于在类中重载 () 运算符。使得类实例对象可以像调用普通函数那样,以“对象名()”的形式使用。class Test(): def __call__(self,name): print("hello, I am ", name)T = Test()T('Alice')>>hello, I am Alice...原创 2021-04-17 15:55:29 · 113 阅读 · 0 评论 -
TypeError: sum() got multiple values for argument ‘x‘
functools.partialdef sum(x,y) : return x+yf = functools.partial( f, y=1 )f(2)3 # Works as expecteddef sum(x,y) : return x+yf = functools.partial( f, x=1 )f(2)TypeError: sum() got multiple values for argument 'x'报错原因:Python first原创 2021-04-17 08:23:06 · 705 阅读 · 0 评论