TypePython Error

TypeError

TypeError: 'int' object is not callable

Traceback

terminal
Traceback (most recent call last):
  File "main.py", line 2, in <module>
    new_list = list("abc")  # list is now a variable, not a function
TypeError: 'int' object is not callable

What causes this error

An object that is not callable (like an int, string, list, or None) was called with parentheses. This often happens from shadowing built-in names or using () instead of [].

How to fix it

Check if you accidentally shadowed a built-in name with a variable. Use [] for indexing, not (). Ensure the object you are calling is actually a function or has a __call__ method.

Code that causes this error

Broken
list = [1, 2, 3]
new_list = list("abc")  # list is now a variable, not a function

Fixed code

Fixed
my_list = [1, 2, 3]
new_list = list("abc")  # built-in list() works

About TypeError

This error is raised when you try to call (use parentheses on) an object that is not callable — i.e., it has no `__call__` method. The most common causes are: accidentally overwriting a built-in function name with a variable (e.g., assigning `list = [1, 2]` then calling `list()`), using parentheses instead of brackets for indexing (e.g., `mylist(0)` instead of `mylist[0]`), missing an operator between a number and parentheses (e.g., `5(x+1)` instead of `5*(x+1)`), and calling a property as if it were a method. This error is particularly insidious when a built-in like `len`, `str`, `int`, `list`, or `dict` gets shadowed by a variable assignment, because the shadowing may happen far from where the error occurs.

Using a linter that warns about shadowing built-in names prevents the most common variant.

Common scenarios

1

Performing operations between incompatible types like strings and integers

2

Calling methods that return None and chaining operations on the result

3

Passing the wrong number or type of arguments to a function

4

Using bracket notation on objects that do not support indexing

Related errors