Skip to main content

Example — Glossary Content Type

Example title: Python Glossary

Guidance: Use glossary for term → definition entries that answer "what is X?" Keep one term per H2, lead with a one-sentence definition, and aim for 8–15 terms so every heading carries real content.

Example content

Common Python terms used throughout these docs, each defined in one or two sentences so the page works as a quick lookup.

Module​

A .py file that Python can import. Modules group related functions, classes, and variables.

Package​

A directory containing an __init__.py file (or a namespace package) that groups related modules.

Virtual environment​

An isolated Python environment with its own interpreter and installed packages, created with python -m venv.

Duck typing​

Python's approach of determining an object's suitability by the presence of methods and attributes rather than its declared type.

Decorator​

A callable that wraps another function or class to extend its behavior without changing its source. Decorators are applied with the @decorator syntax.

Generator​

A function that yields values lazily with yield, producing an iterator instead of building the whole result in memory.

Context manager​

An object that defines setup and teardown behavior for a with block, typically through __enter__ and __exit__.

Bytecode​

The intermediate instructions the Python compiler produces and the interpreter executes. Bytecode is usually cached in __pycache__ directories.

Each term should link to the deepest existing post on that concept, e.g. Python Quick Reference.