Title: Python Keywords & Identifiers -- `list` Shadowing Crash
Open Graph Title: Python Keywords & Identifiers -- `list` Shadowing Crash
Description: A variable named `list` triggered `TypeError: 'list' object is not callable` in production. See how to catch built-in shadowing with CI checks.
Open Graph Description: A variable named `list` triggered `TypeError: 'list' object is not callable` in production. See how to catch built-in shadowing with CI checks.
Opengraph URL: https://thecodeforge.io/python/python-keywords-identifiers/
Domain: thecodeforge.io
{
"@context": "https://schema.org",
"@type": "TechArticle",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://thecodeforge.io/python/python-keywords-identifiers/"
},
"headline": "Python Keywords & Identifiers -- `list` Shadowing Crash",
"description": "A variable named `list` triggered `TypeError: 'list' object is not callable` in production. See how to catch built-in shadowing with CI checks.",
"keywords": "Python Keywords & Identifiers -- `list` Shadowing Crash, Python, Beginner, Python Basics, A variable named `list` triggered `TypeError: 'list' object is not callable` in production. See how to catch built-in shadowing with CI checks.",
"proficiencyLevel": "Beginner",
"author": {
"@type": "Person",
"@id": "https://thecodeforge.io/about/#naren",
"name": "Naren",
"url": "https://thecodeforge.io/about/"
},
"publisher": {
"@type": "Organization",
"@id": "https://thecodeforge.io/#org",
"name": "TheCodeForge",
"url": "https://thecodeforge.io",
"logo": {"@type": "ImageObject", "url": "https://thecodeforge.io/assets/og-image.png"}
},
"datePublished": "2026-03-05T00:00:00+00:00",
"dateModified": "2026-10-31T00:00:00+00:00",
"url": "https://thecodeforge.io/python/python-keywords-identifiers/",
"inLanguage": "en",
"educationalLevel": "Beginner",
"image": "https://thecodeforge.io/assets/og-image.png",
"isPartOf": {"@id": "https://thecodeforge.io/#website"}
}
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{"@type": "ListItem", "position": 1, "name": "Home", "item": "https://thecodeforge.io/"},
{"@type": "ListItem", "position": 2, "name": "Python", "item": "https://thecodeforge.io/python/"},
{"@type": "ListItem", "position": 3, "name": "Python Keywords & Identifiers -- `list` Shadowing Crash", "item": "https://thecodeforge.io/python/python-keywords-identifiers/"}
]
}
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "How many keywords does Python have?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Python 3.12 has exactly 35 keywords. This number has changed across Python versions — Python 3.5 added 'async' and 'await', for example. You can always get the exact count for your version by running 'import keyword; print(len(keyword.kwlist))' in your Python environment."
}
},
{
"@type": "Question",
"name": "Is 'None' a keyword in Python?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Yes, 'None' is one of Python's 35 keywords — and it must be written with a capital N. It represents the complete absence of a value, similar to 'null' in other languages. 'none' (all lowercase) is not a keyword and could technically be used as a variable name, though doing so is a recipe for confusion."
}
},
{
"@type": "Question",
"name": "What is the difference between a Python keyword and an identifier?",
"acceptedAnswer": {
"@type": "Answer",
"text": "A keyword is a word with a fixed, built-in meaning that Python's interpreter recognises before your code even runs — you cannot use keywords as variable names. An identifier is a name you choose for your own variables, functions, and classes — it follows Python's naming rules but its meaning is entirely up to you. Keywords are the language's vocabulary; identifiers are your vocabulary inside that language."
}
},
{
"@type": "Question",
"name": "Can I use 'print' as a variable name in Python?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Yes, technically — 'print' is not a keyword (check with `keyword.iskeyword('print')` -> False). You CAN assign `print = 42` without a SyntaxError. But doing so shadows the built-in `print()` function, and any later call to `print(...)` in that scope will raise `TypeError: 'int' object is not callable`. Never use built-in names as identifiers."
}
},
{
"@type": "Question",
"name": "What does a syntax error for an invalid identifier look like?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Run `1player = 5` — you'll get `SyntaxError: invalid decimal literal`. For a hyphen: `player-score = 10` gives `SyntaxError: cannot assign to operator here. Maybe you meant '==' instead of '='?`. For a keyword: `for = 2` gives `SyntaxError: cannot assign to for`. The message varies but always points to the line where the parser got confused."
}
}
]
}
| og:type | website |
| og:image | https://thecodeforge.io/assets/og-image.png |
| og:image:width | 1200 |
| og:image:height | 630 |
Links:
Viewport: width=device-width, initial-scale=1.0
Robots: max-image-preview:large