1. 程式人生 > >Python: TypeError: 'dict' object is not callable

Python: TypeError: 'dict' object is not callable

color call error gpo -c typeerror python字典 type 問題

問題: TypeError: ‘dict‘ object is not callable

原因: dict()是python的一個內建函數,如果將dict自定義為一個python字典,在之後想調用dict()函數是會報出“TypeError: ‘dict‘ object is not callable”的錯誤,

解決辦法: >>>del (dict)

Python: TypeError: 'dict' object is not callable