Skip to content
Python logo

Python

First appeared 1991 · Guido van Rossum

The readable general-purpose language that became the default for data, AI and automation.

Overview

Python is a high-level, interpreted programming language known for its simplicity, readability, and versatility. Developed in the late 1980s by Guido van Rossum, Python was designed to emphasize code readability and developer productivity. Over the decades, it has grown into one of the most widely used programming languages in the world, powering applications in web development, data science, artificial intelligence, scientific computing, automation, and more. Python's syntax is clean and expressive, making it accessible to beginners while still being powerful enough for large-scale professional software development. Its extensive standard library, combined with a rich ecosystem of third-party packages available via PyPI, allows developers to quickly build robust solutions for almost any domain. Python supports multiple programming paradigms, including procedural, object-oriented, and functional programming, offering flexibility and scalability for various types of projects. Its popularity is bolstered by a vibrant global community, comprehensive documentation, tutorials, conferences like PyCon, and widespread adoption in industry and academia. Python's influence is significant, shaping the design of many modern languages and software development practices.

Key facts

The reference details, without the paragraph.

First appeared
1991
Designed by
Guido van Rossum
Typing
Dynamic and strong, with optional static type hints (PEP 484)
Execution
Compiled to bytecode, executed by the CPython virtual machine
Memory model
Automatic — reference counting plus a cycle-collecting garbage collector
Package manager
pip and uv, backed by PyPI
File extensions
.py, .pyi, .pyw
Current line
Python 3.14, released October 2025
Release cadence
One feature release every October, five years of support each
Licence
PSF License — permissive and GPL-compatible

History

How the language got here — the decisions that still shape how you write it.

Python was created by Guido van Rossum at Centrum Wiskunde & Informatica (CWI) in the Netherlands during the late 1980s. Inspired by the ABC programming language, which aimed to be an educational tool for beginners but had several limitations, Guido wanted to create a language that combined ease of use with the power required for real-world programming tasks. The first public release, Python 0.9.0, appeared in 1991 and included key features such as exception handling, functions, and core data types like lists and dictionaries. Python's philosophy emphasizes code readability, simplicity, and explicitness, a philosophy formalized in the 'Zen of Python' which guides the language's development. Over the years, Python has evolved through major versions, adding features like object-oriented programming, modules, libraries for numerical computing, web frameworks, asynchronous programming, type annotations, and enhanced performance. Its role in scientific computing, data analysis, artificial intelligence, and machine learning is particularly notable, with libraries like NumPy, pandas, TensorFlow, and PyTorch empowering researchers and engineers to solve complex problems efficiently. Python's community-driven development ensures that it continues to adapt to modern programming challenges while maintaining backward compatibility and readability. Guido van Rossum served as Python's BDFL (Benevolent Dictator For Life) until 2018, providing consistent guidance to the language’s evolution. Python remains a top choice for beginners learning programming concepts, professionals building production-grade applications, and educators teaching computational thinking and coding skills. Its combination of readability, extensive libraries, active community, and versatility has made Python an enduring and influential programming language.

  1. 1989

    A Christmas-break project

    Guido van Rossum starts Python at CWI in Amsterdam as a successor to the teaching language ABC — keeping ABC's readability, dropping its inability to talk to the operating system.

  2. 1991

    Python 0.9.0 goes public

    The first release already has exceptions, functions, modules and the core types — lists, dicts, strings. The shape of the language you write today is recognisable from the very first version.

  3. 2000

    Python 2.0

    List comprehensions, Unicode support and a cycle-detecting garbage collector arrive. Development moves to a public, community-run process.

  4. 2008

    Python 3.0 breaks compatibility on purpose

    A deliberate cleanup that finally separates text from bytes, makes print a function and fixes integer division. The migration took over a decade — a case study in the real cost of breaking changes.

  5. 2015

    The scientific stack wins

    NumPy, pandas, scikit-learn and Jupyter turn Python into the default language of data analysis and, shortly after, machine learning.

  6. 2018

    Guido steps down as BDFL

    After the contentious walrus-operator debate, Guido resigns as Benevolent Dictator For Life. Governance passes to an elected five-member Steering Council.

  7. 2020

    Python 2 reaches end of life

    January 2020 closes an eleven-year transition. Python 3 is now simply 'Python'.

  8. 2023

    PEP 703 accepted — the GIL becomes optional

    The Steering Council accepts a plan to make CPython's global interpreter lock removable, opening the door to real multi-core threading.

  9. 2025

    Python 3.14 supports free-threading officially

    The free-threaded build graduates from experimental to officially supported, alongside continued work on a JIT compiler.

What it is good at

The reasons teams pick it, stated concretely.

  • You can read it a year later

    Significant whitespace and a small keyword set mean Python code has an unusually narrow range of styles. Code written by a stranger tends to look like code you would have written, which is worth more on a long-lived project than any single feature.

  • An ecosystem with no real rival for data and AI

    NumPy, pandas, PyTorch, scikit-learn and the Hugging Face stack mean that for numerical and machine-learning work the question is rarely 'is there a library' but 'which of the four mature ones fits'.

  • Batteries genuinely included

    The standard library ships HTTP clients and servers, JSON, CSV, SQLite, zip archives, subprocess control, unit testing, argument parsing and date maths. A surprising number of useful programs need zero third-party dependencies.

  • Excellent glue over fast native code

    Python's C API means the hot loops live in C, C++, Rust or Fortran while you stay in Python. NumPy, PyTorch and Polars are all fast native engines wearing a Python interface — you get the ergonomics without paying the interpreter cost where it matters.

  • A gentle slope with a high ceiling

    The same language serves a first-week beginner writing a loop and a team running production inference at scale. Few languages cover that range without a rewrite.

Trade-offs

Every language costs you something. Knowing what, before you commit, is the whole point.

  • Raw interpreted speed

    Pure-Python numeric loops run one to two orders of magnitude slower than equivalent C. This matters far less than it sounds — the usual fix is to push the loop into NumPy or a native extension — but if your hot path genuinely must stay in Python, it will hurt.

  • The GIL constrains CPU-bound threads

    In the standard build, one lock means threads cannot execute Python bytecode in parallel. I/O-bound work is fine; CPU-bound work needs multiprocessing, a native extension, or the new free-threaded build.

  • Packaging has a long history of sharp edges

    Virtual environments, wheels, system Python and conflicting resolvers have burned every Python developer at least once. Modern tooling (uv, Poetry, PEP 621 pyproject.toml) has largely fixed this, but tutorials written before it are still everywhere.

  • Dynamic typing defers errors to runtime

    A typo in a rarely-taken branch can survive to production. Type hints plus mypy or pyright recover most of the safety, but they are opt-in and only as good as your coverage.

  • Weak story for client-side deployment

    Shipping Python to a phone, a browser or an end user's desktop means bundling an interpreter. PyInstaller and Pyodide exist and work, but this is not where Python is strongest.

Code examples

Not syntax tours — the idioms that make code read like the language rather than a translation of another one.

The data structures do the work
from collections import Counter

text = "the quick brown fox jumps over the lazy dog the end"

# Comprehensions read like the sentence describing them.
long_words = [w for w in text.split() if len(w) > 3]

# Counter is a dict that knows how to tally.
frequency = Counter(text.split())

print(long_words)                 # ['quick', 'brown', 'jumps', 'over', 'lazy']
print(frequency.most_common(2))   # [('the', 3), ('quick', 1)]
Most Python programs are short because the standard library already contains the data structure you were about to write. Reach for `collections` before writing a loop that counts, groups or queues.
Type hints and dataclasses
from dataclasses import dataclass

@dataclass(frozen=True, slots=True)
class Book:
    title: str
    author: str
    year: int
    tags: list[str] | None = None

    def citation(self) -> str:
        return f"{self.author} ({self.year}). {self.title}."

book = Book("Fluent Python", "Ramalho", 2022)
print(book.citation())   # Ramalho (2022). Fluent Python.
`@dataclass` generates `__init__`, `__repr__` and `__eq__` from the annotations. `frozen=True` makes instances immutable and hashable; `slots=True` cuts memory use. The hints are ignored at runtime but let mypy or pyright catch mistakes before you run the code.
Context managers close what you open
import sqlite3
from contextlib import contextmanager

@contextmanager
def database(path: str):
    connection = sqlite3.connect(path)
    try:
        yield connection
        connection.commit()
    except Exception:
        connection.rollback()
        raise
    finally:
        connection.close()

with database("library.db") as db:
    db.execute("INSERT INTO books VALUES (?, ?)", ("Dune", 1965))
# Committed on success, rolled back on failure, closed either way.
The `with` statement guarantees cleanup even when an exception unwinds the stack. Writing your own context manager is a decorator and a `yield` — this is how Python handles the resource-safety problem that RAII solves in C++.
asyncio for I/O-bound concurrency
import asyncio
import httpx

async def fetch(client: httpx.AsyncClient, url: str) -> int:
    response = await client.get(url, timeout=10)
    return len(response.content)

async def main() -> None:
    urls = [f"https://httpbin.org/bytes/{n}" for n in (100, 200, 300)]
    async with httpx.AsyncClient() as client:
        sizes = await asyncio.gather(*(fetch(client, u) for u in urls))
    print(sizes)   # [100, 200, 300] — three requests, one round trip of waiting

asyncio.run(main())
`asyncio.gather` runs the requests concurrently on a single thread. This is the right tool when your program spends its time waiting on the network or disk. For CPU-bound work use `multiprocessing` instead — async will not help there.

Common pitfalls

The mistakes that cost everyone an afternoon at least once.

  • Mutable default arguments

    `def add(item, bucket=[])` creates the list once, at definition time, and every call shares it. Use `bucket=None` and build the list inside the function.

  • `is` is not `==`

    `is` compares identity, `==` compares value. Small integers and short strings are cached, so `a is b` sometimes appears to work — until it silently does not. Use `is` only for `None`, `True` and `False`.

  • Late binding in closures

    `[lambda: i for i in range(3)]` gives three functions that all return 2, because they capture the variable, not its value. Bind it with a default argument: `lambda i=i: i`.

  • Shadowing standard library modules

    Naming your file `random.py` or `json.py` breaks every import of the real module in that directory, usually with a baffling error message.

  • Installing into the system Python

    `sudo pip install` mixes your project's dependencies into the interpreter your operating system relies on. Always create a virtual environment first.

  • Catching bare exceptions

    `except:` swallows `KeyboardInterrupt` and `SystemExit` along with real errors, making programs impossible to stop and bugs impossible to see. Catch the specific exception you expect.

In production

Where it is running at scale, and what it is doing there.

  • Google

    Backend services, AI and machine learning frameworks, automation scripts.

  • Netflix

    Data analysis, recommendation algorithms, backend services.

  • Spotify

    Data analytics pipelines and machine learning.

  • Dropbox

    File storage backend, desktop client applications.

Learning path

A realistic order to learn things in, with something to build at each step.

  1. 1

    Days 1–7

    The core language

    Variables, `if`/`for`/`while`, functions, and the four workhorse types: list, dict, set, tuple. Learn what mutability means early — it explains a whole class of later confusion.

    Build this: Write a script that reads a text file and prints the ten most common words.

  2. 2

    Weeks 2–3

    Structuring real programs

    Modules and imports, classes and dunder methods, exceptions, comprehensions, and the standard library modules you will use forever: `pathlib`, `json`, `csv`, `datetime`, `re`, `collections`.

    Build this: Turn the word-counter into a package with a command-line interface using `argparse`.

  3. 3

    Week 4

    Environments and tooling

    Virtual environments, `pyproject.toml`, installing with pip or uv, formatting with Ruff, and writing tests with pytest. This is the step most self-taught developers skip and later regret.

    Build this: Add pytest tests and a `pyproject.toml`, then install your own package with `pip install -e .`.

  4. 4

    Months 2–3

    Pick a domain and go deep

    Web with FastAPI or Django; data with pandas, NumPy and Matplotlib; automation with Requests, Playwright and Click. Depth in one area teaches more than breadth across three.

    Build this: Ship something small end to end — a deployed API, a scheduled scraper, or a notebook that answers a real question.

  5. 5

    Ongoing

    The things that separate working from good

    Type hints with mypy or pyright, `asyncio` for I/O concurrency, generators and iterators, decorators, profiling with `cProfile`, and reading the CPython standard library source when the docs run out.

    Build this: Profile a slow script and make it ten times faster without rewriting it in another language.

Ecosystem and tooling

The tools you will end up installing whichever project you join.

ToolWhat it does
uvVery fast installer, resolver and environment manager; increasingly the default over pip + venv
pip + venvThe built-in installer and virtual environment tools — always available, no extra install
PoetryDependency management and publishing with a lockfile, popular for libraries
RuffLinter and formatter that replaces Flake8, isort and Black in one fast binary
mypy / pyrightStatic type checkers that turn optional hints into real error detection
pytestThe de facto testing framework; plain functions, `assert`, and a deep plugin ecosystem
JupyterNotebook environment for exploration, teaching and reproducible analysis
CPython / PyPyThe reference implementation, and a JIT alternative that speeds up long-running pure-Python code

Python libraries

84 catalogued, each with installation, worked examples and best practices.

Frequently asked

Is Python fast enough for production?

For the overwhelming majority of workloads, yes — most services spend their time waiting on a database or network, not on the interpreter. Where raw compute matters, the standard answer is to keep the hot path in NumPy, a Rust or C extension, or a compiled library, and keep Python as the orchestration layer. Instagram, Dropbox and much of the machine-learning industry run this way.

Which Python version should I install?

The most recent stable release, unless a dependency you need has not caught up. Every version from 3.9 back is end of life and receives no security patches. Anything labelled Python 2 is a historical artefact — it stopped receiving updates in January 2020.

Do I actually need type hints?

Not for a fifty-line script. For anything a second person will read or that lives longer than a month, they pay for themselves: your editor gets real autocomplete, refactors become safe, and a type checker catches a category of bug that tests usually miss. Add them gradually — partial coverage is genuinely useful.

Is the GIL still a problem?

Less than it was. It never affected I/O-bound work, which is most web and scripting code. For CPU-bound work the traditional answers — `multiprocessing`, or dropping into a native library that releases the lock — still work, and since Python 3.14 the free-threaded build removes the lock entirely as an officially supported option.

pip, Poetry, conda or uv?

For a new project in 2026, uv is the fastest path and speaks standard `pyproject.toml`. Poetry is a solid choice if you publish libraries. conda earns its keep when you need non-Python binaries such as CUDA builds or scientific Fortran. Plain pip plus venv is always available and perfectly fine for small projects.

Python or JavaScript as a first language?

Python if you want to learn programming concepts with the least syntax noise, or if you are heading for data, science or automation. JavaScript if you want to see results in a browser immediately and are heading for web front-end work. Both are excellent first languages, and the second one is far easier than the first.