Fix: TypeError ‘list’ object is not callable in Python

TypeError: 'list' object is not callable in Python means you put parentheses after something that’s a list, so Python tried to call it like a function. Usually you named a variable list, or used () where indexing needs []:

prices = [19.99, 4.50]
prices(0)    # TypeError: 'list' object is not callable
prices[0]    # 19.99

Every traceback below is real output from Python 3.12.5, with the fix right after it.

We’ll go through the four usual causes: shadowing the built-in list, round brackets for indexing, a variable that replaced a function, and calling something that isn’t a method.

Cause 1: You named a variable list

In my experience this is the most common one. Assigning to list hides the built-in list() function for the rest of the file, so a later list(...) calls your list instead:

list = ["Austin", "Denver", "Boston"]      # this hides the built-in list() function
print(list)

cities = list(("Tampa", "Reno"))            # now "list" is your list, not the type

Output:

['Austin', 'Denver', 'Boston']
Traceback (most recent call last):
  File "C:\pyguides\list_shadow.py", line 4, in <module>
    cities = list(("Tampa", "Reno"))            # now "list" is your list, not the type
             ^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'list' object is not callable
Command Prompt traceback of TypeError list object is not callable after assigning a Python variable named list
The first line works; the error appears later, wherever list(...) is used. That delay is what makes it confusing.

The fix is to rename the variable, then remove the bad one if your session still has it. In a notebook or REPL, del list brings the built-in back:

cities = ["Austin", "Denver", "Boston"]     # use a descriptive name instead
print(list(("Tampa", "Reno")))

list = ["oops"]
del list                                    # removes your variable, the built-in is back
print(list("abc"))

import builtins
print(builtins.list(range(3)))              # the original is always here too

Output:

['Tampa', 'Reno']
['a', 'b', 'c']
[0, 1, 2]
Command Prompt output of a Python fix for list object is not callable: renaming, del list, and builtins.list
After del list, the built-in works again. builtins.list is always available as a backup.

In Jupyter, the bad variable survives until you delete it or restart the kernel, even after you fix the cell that created it.

Cause 2: Calling a list with () instead of indexing with []

Indexing uses []. Writing prices(0) asks Python to call the list with the argument 0:

prices = [19.99, 4.50, 102.00]
print(prices[0])                            # square brackets: indexing
print(prices(0))                            # parentheses: tries to call the list

Output:

19.99
Traceback (most recent call last):
  File "C:\pyguides\list_parens.py", line 3, in <module>
    print(prices(0))                            # parentheses: tries to call the list
          ^^^^^^^^^
TypeError: 'list' object is not callable
Command Prompt traceback of a Python list called with parentheses instead of indexed with square brackets
prices[0] works; prices(0) raises the TypeError. Python even underlines the call.

Out-of-range square brackets give a different error; see IndexError: list index out of range.

Cause 3: A list variable replaced a function

If a function returns a list and you assign the result to the function’s own name, the function is gone. The next call tries to call the list:

def totals():
    return [42.50, 18.00, 120.25]

totals = totals()           # the name now points at the result, not the function
print(totals)
print(totals())             # calling the list fails

Output:

[42.5, 18.0, 120.25]
Traceback (most recent call last):
  File "C:\pyguides\list_function.py", line 6, in <module>
    print(totals())             # calling the list fails
          ^^^^^^^^
TypeError: 'list' object is not callable
Command Prompt traceback after a Python function name was reassigned to the list it returned, then called again
totals = totals() replaced the function with its result.

Use different names, like order_totals = get_totals(). The same mistake gives 'tuple' object is not callable for tuples; see tuple object is not callable.

Cause 4: Calling something that isn’t a list method

Lists have methods like append() and count(), but not everything is a method. The length comes from the len() function:

orders = [101, 102, 103]

print(len(orders))              # len() is a function, not a list method
print(orders.count(102))         # count IS a method, so call it with ()

try:
    orders.length()              # lists have no .length
except AttributeError as err:
    print("AttributeError:", err)

Output:

3
1
AttributeError: 'list' object has no attribute 'length'

For more on len(), see the len() function in Python.

How do you find which built-in list or dict you shadowed?

Compare names against the builtins module. This quick check lists any common built-ins your code has replaced:

list = [1, 2, 3]
import builtins

print("list is the built-in?", list is builtins.list)
shadowed = [name for name in ("list", "dict", "str", "sum", "max") if globals().get(name) is not None
            and globals()[name] is not getattr(builtins, name)]
print("shadowed built-ins:", shadowed)

Output:

list is the built-in? False
shadowed built-ins: ['list']

I rely on linters such as Ruff and Pylint, which warn about shadowing built-ins as you type, which stops this error before it happens.

Quick fixes for ‘list’ object is not callable

If your code hasChange it to
list = [...]cities = [...], then del list in notebooks
items(0)items[0]
result = result()data = result()
items.length()len(items)

Other Python error guides you may need:

Frequently asked questions

What does ‘list’ object is not callable mean?

You used parentheses after a list, so Python tried to call it like a function. Lists can be indexed with [] but not called with ().

How do I fix it after naming a variable list?

Rename the variable, and run del list (or restart your notebook kernel) to restore the built-in.

Why does the error appear on a different line than the mistake?

The assignment to list works fine; the error only shows up later when something tries to call list().

Can this happen with other built-ins?

Yes. Naming variables dict, str, sum or max causes the same kind of error for those.

How do I prevent it?

Use descriptive names and a linter that flags shadowed built-ins.

Where is list() documented?

See list() in the Python built-in functions docs.