python中 TypeError: ‘XXX‘ object is not callable报错原因
使用Python过程中遇到类似这种报错,是因为自定义了一个变量/函数,与python内置的关键字冲突了。自定义的变量会覆盖python内置函数,调用函数时就会出现TypeError报错如:str = 'test'print(str(1))报错如下:Traceback (most recent call last): File "<stdin>", line 1, in <module>TypeError: 'str' object is not callable
原创
2021-03-25 22:54:58 ·
27540 阅读 ·
1 评论