TypeError:'dict' object is not callable

TypeError:'dict' object is not callable

 

出现这种错误有两种可能:

1. 代码里重新定义了dict,比如 dict= {...},这时调用的是代码里定义的dict而不是python内置类型

2. 取字典内容时用了()而不是[]。比如sdict("content_id"),应该是sdict["content_id"]

posted @ 2017-09-04 21:21  li6322298  阅读(7775)  评论(0编辑  收藏  举报