1 답변
-
TypeError: 'xxx' is not callable
은 함수가 아닌 것을 함수호출처럼 썼을 때, ( 즉, 바로 뒤에()
가 있을 때 ) 발생합니다.예를 보여드릴께요.
>>> a = 1 >>> a() Traceback (most recent call last): File "<pyshell#3>", line 1, in <module> a() TypeError: 'int' object is not callable >>> b = "abc" >>> b(3, 4) Traceback (most recent call last): File "<pyshell#4>", line 1, in <module> b(3, 4) TypeError: 'str' object is not callable >>> c = range(32) >>> c(33, "a") Traceback (most recent call last): File "<pyshell#5>", line 1, in <module> c(33, "a") TypeError: 'range' object is not callable
댓글 입력