简体   繁体   English

TypeError: 'str' object 不可调用,当调用 function

[英]TypeError: 'str' object is not callable, when calling a function

I am calling this huge function:我称这个巨大的 function:

arc(w, d, h, name, old_sx_value_1, old_ex_value_1, old_ey_value_1, old_sy_value_4, old_ey_value_4,
    old_ex_value_5, old_sx_value_7, old_sy_value_10, old_sx_value_13, old_ex_value_16, old_sx_value_17,
    old_sx_value_19, old_sy_value_19, old_sy_value_21)

The problem is that I receive this error:问题是我收到此错误:

    ...old_sx_value_19, old_sy_value_19, old_sy_value_21)
TypeError: 'str' object is not callable

I checked and the only str in here is "name", the other ones are floats.我检查了一下,这里唯一的 str 是“name”,其他的是 floats。 None of the variables above are global, but I have global variables for my paths上面的变量都不是全局变量,但我的路径有全局变量

The TypeError: 'str' object is not callable came because I had a global variable with the same name as my function. TypeError: 'str' object is not callable来了,因为我有一个与我的 function 同名的全局变量。 I just renamed it and it worked我刚刚重命名它并且它有效

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM