Python was first released in February 1991, when Guido van Rossum posted version 0.9.0 to the alt.sources newsgroup. He had started it as a hobby project over the Christmas holidays of 1989 at Centrum Wiskunde & Informatica (CWI) in Amsterdam. The short answer to why Python uses indentation instead of curly braces is that van Rossum had spent years working on ABC, a teaching language at CWI that used indentation for blocks, and he kept the idea because it made programs easier to read.

Origins at CWI

ABC was designed for beginners and had good ideas, including indentation, high-level data types and an interactive prompt, but it was closed and hard to extend. Van Rossum was also working on the Amoeba distributed operating system and wanted a scripting language that sat between shell scripts and C. Python was his attempt to keep ABC's clarity while adding exceptions, modules and easy access to C libraries. The name came from Monty Python's Flying Circus, not the snake, which is why the documentation is full of "spam" and "eggs".

Van Rossum led the language as its "Benevolent Dictator For Life" until July 2018, when he stepped down after the contentious debate over the walrus operator (PEP 572). Since 2019 a five-person Steering Council has governed Python, and the Python Software Foundation, founded in 2001, owns the intellectual property.

Why Python uses indentation instead of curly braces

Most C-family languages mark blocks with braces and indent only for readability, so the visual structure and the actual structure can disagree. Python makes them the same thing. A block starts after a colon and continues as long as lines stay indented; this layout rule is often called the "off-side rule", a term coined by Peter Landin in the 1960s.

  • Readability: code looks the way it executes, so misleading indentation bugs disappear.
  • Less noise: no closing braces or end keywords cluttering the page.
  • Consistency: different authors' code tends to look alike, reinforced by the PEP 8 style guide.

The trade-off is that mixing tabs and spaces can cause trouble, which Python 3 addressed by refusing inconsistent mixtures. Try from __future__ import braces in an interpreter for the developers' own answer to requests for braces.

A short Python example

from collections import Counter

def top_words(text, n=3):
    words = [w.strip(".,!?").lower() for w in text.split()]
    for word, count in Counter(words).most_common(n):
        if count > 1:
            print(f"{word}: {count}")

top_words("Spam, spam, eggs and spam. Eggs are fine.")

The function body and the loop body are defined purely by indentation.

Versions timeline

YearReleaseNotable change
19910.9.0Classes, exceptions, core types
19941.0lambda, map, filter, reduce
20002.0List comprehensions, garbage collector for cycles
20083.0Unicode strings, cleaned-up language, not backward compatible
20202.7 end of lifePython 2 officially retired on 1 January
20243.13Experimental free-threaded build and JIT

The move from Python 2 to Python 3 took more than a decade, one of the longest migrations in programming history. Since 2019 new versions arrive yearly each October.

Where Python is used today

Python's breadth is its main strength:

  • Data science and machine learning: NumPy, pandas, scikit-learn, PyTorch and TensorFlow made Python the default language for AI research.
  • Web backends: Django (2005) powers Instagram's backend, and Flask and FastAPI are widely used.
  • Automation and DevOps: Ansible, countless build scripts and most Linux distributions rely on it.
  • Embedded scripting: Blender, GIMP, QGIS and Autodesk Maya use Python for plugins.
  • Education: it is now the most common first language taught in universities.

Dropbox, where van Rossum worked from 2013 to 2019, and YouTube were early large-scale users.

Influence and legacy

Python made significant whitespace mainstream; Nim, CoffeeScript, F# (light syntax) and YAML all use indentation for structure. Its "batteries included" standard library and the PyPI package index became models for other ecosystems, and type hints (PEP 484, 2014) showed how a dynamic language could adopt optional static checking. Knowing why Python uses indentation instead of curly braces tells you most of what the language values: code is read far more often than it is written.

Frequently asked questions

Can you use curly braces in Python at all?

Not for blocks. Braces in Python create dictionaries and sets, and appear in f-string placeholders. Running from __future__ import braces raises a joke error: "SyntaxError: not a chance".

How many spaces should Python indentation use?

PEP 8 recommends four spaces per level, and nearly all Python projects follow it. The interpreter accepts any consistent amount. Mixing tabs and spaces inconsistently raises a TabError in Python 3.

Where did Python get indentation-based syntax from?

It came directly from ABC, which Guido van Rossum helped implement at CWI in the 1980s. The underlying idea goes back further, to Peter Landin's ISWIM and his "off-side rule". Haskell, developed around the same time, also uses layout-sensitive syntax.