python
type_error
ai_generated
true
TypeError: 'int' object is not callable
ID: python/typeerror-not-callable
95%Fix Rate
95%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 311 | active | — | — | — |
Root Cause
Variable shadows a function name. Common: len = len(x) then calling len() again.
genericWorkarounds
-
95% success Find where a variable shadows the builtin/function name and rename the variable
# Bad: list = [1,2,3]; list() → Fix: my_list = [1,2,3]
-
85% success Check for missing operator: f(x)(y) might need f(x) * (y)
f(x)(y) might need f(x) * (y)
Sources: https://docs.python.org/3/reference/expressions.html
Dead Ends
Common approaches that don't work:
-
Rename the function
80% fail
The function is a builtin — you shadowed it with a variable
-
Cast the object to callable type
75% fail
The object is genuinely not callable — casting won't help
Error Chain
Frequently confused with: