TypeError: Object is Not Callable

TypeError: 'int' object is not callable

Quick Answer

You are trying to call a non-callable object like an integer or list as if it were a function. This usually happens when you shadow a built-in name with a variable. Rename your variable to avoid conflicting with built-in names.

Why This Happens

Python allows you to reassign built-in names like list, str, int, or len to regular values. Once you do, the original built-in is shadowed in that scope. When you later try to call the built-in, Python finds your variable instead and tries to call it, raising TypeError.

The Problem

sum = 100
total = sum([1, 2, 3])  # 'int' object is not callable

The Fix

total_value = 100
total = sum([1, 2, 3])  # Works fine

Step-by-Step Fix

  1. 1

    Find the shadowed name

    Search your code for any variable assignment that uses a built-in name like list, dict, sum, type, id, or input.

  2. 2

    Rename the variable

    Change the variable name to something descriptive that does not conflict with Python built-ins.

  3. 3

    Restart your REPL if needed

    If you are in an interactive session, the shadowed name persists. Restart or use del to remove the binding.

Bugsly catches this automatically

Bugsly's AI analyzes this error pattern in real-time, explains what went wrong in plain English, and suggests the exact fix — before your users even report it.

Try Bugsly free