Python Cheat Sheet
Python programming terms explained
43 terms
- asyncio
- Python's standard library module for writing single-threaded concurrent code using coroutines, event loops, and non-blocking I/O — the foundation of modern async Python frameworks like FastAPI and aiohttp.
- Celery
- An open-source distributed task queue for Python applications, commonly used for asynchronous jobs and scheduled work.
- Conda
- A cross-platform package and environment manager commonly used in Python, data science, and scientific computing workflows. In developer culture Conda is especially associated with environments that need native libraries and reproducible research setups.
- Conda Forge
- A community-driven collection of Conda packages and recipes maintained outside the default Anaconda channels. In scientific and open-source culture, Conda Forge is valued for breadth, freshness, and community stewardship.
- Data Class
- A class designed primarily to hold data, with automatically generated methods like equality checks, hashing, and string representation. Python's @dataclass decorator and Kotlin's data class keyword both eliminate boilerplate for simple value objects.
- Decorator
- A design pattern or language feature that wraps a function or class to modify its behavior without changing its source code. In Python, decorators use the @syntax to apply higher-order functions. Common uses include logging, caching, authentication, and route registration.
- Django
- Django is a high-level Python web framework that follows the model-template-view (MTV) architectural pattern and emphasizes rapid development, clean design, and the principle of not repeating yourself (DRY). Created by Adrian Holovaty and Simon Willison at the Lawrence Journal-World newspaper in 200
- Dynamic Typing
- A type system where variable types are determined and checked at runtime rather than at compile time. Python, JavaScript, and Ruby are dynamically typed — a variable can hold a string one moment and a number the next.
- Flask
- A lightweight Python web microframework that provides the essentials — routing, request handling, templating — without imposing an ORM, form library, or project structure. The opposite of Django's batteries-included approach.
- Generator
- A special type of function that returns an iterator which yields values one at a time using lazy evaluation, pausing execution between each yield and resuming where it left off when the next value is requested.
- Gunicorn
- A Python WSGI HTTP server commonly used to run web applications in production.
- Jinja
- A Python templating engine that renders text or HTML from templates containing expressions, control flow, filters, and variables. It is widely used in Flask, Ansible, and other Python tooling to separate presentation templates from application logic.
- Jupyter
- An open-source platform for interactive computing that lets users create notebook documents combining live code, equations, visualizations, and narrative text. The name references the three core languages it originally supported — Julia, Python, and R. Jupyter notebooks have become the standard medi
- Kivy
- An open source Python framework for building cross-platform graphical applications, especially touch-friendly apps that run on desktop and mobile devices. Kivy provides its own widget toolkit, rendering pipeline, and layout language rather than wrapping native platform controls directly.
- LangChain
- Line Profiler
- A profiling tool that measures execution time or hit count for each individual line of source code, rather than at the function level. Python's `line_profiler` (kernprof) and Ruby's `rblineprof` are common examples, useful for pinpointing exactly which line in a hot function is the bottleneck.
- List Comprehension
- A concise syntactic construct for creating lists by applying an expression to each item in an iterable, optionally filtering with a condition — common in Python, Haskell, and similar languages.
- Magic Method
- A specially named method in Python (surrounded by double underscores, like `__init__`, `__getattr__`, `__add__`) that the interpreter calls implicitly in response to operations such as object construction, attribute access, or operator use. Also called dunder methods.
- Metaclass
- A class whose instances are themselves classes — it defines how classes behave, enabling customization of class creation, attribute access, and inheritance.
- Method Resolution Order
- The linearized sequence in which a language searches a class's inheritance hierarchy to find a method implementation, most famously computed in Python using the C3 linearization algorithm to produce a deterministic, consistent ordering for multiple inheritance.
- NumPy
- The foundational Python library for numerical computing, providing support for large multi-dimensional arrays, matrices, and a vast collection of mathematical functions to operate on them efficiently. Nearly every scientific Python library — from pandas to TensorFlow — is built on top of NumPy's arr
- pandas
- An open-source Python library providing high-performance, easy-to-use data structures (DataFrames and Series) and analysis tools. Built on top of NumPy, pandas is the de facto standard for tabular data manipulation in Python, supporting operations like merging, reshaping, time-series analysis, and h
- pip
- The standard package installer for Python. Fetches and installs packages from PyPI (Python Package Index). Recursive acronym: 'pip installs packages.' The gateway to 500,000+ libraries — and occasionally dependency hell.
- pip Install
- The act of installing a Python package using pip, the standard Python package installer. In developer culture, 'pip install' is such a common workflow phrase that it often stands in for Python package setup more generally.
- Process Pool
- A pre-forked collection of worker processes managed by a parent that dispatches tasks to idle workers and collects results, amortizing the overhead of process creation across many tasks. Python's multiprocessing.Pool and PHP-FPM are canonical examples.
- PyPI
- The Python Package Index — the official third-party software repository for Python, hosting over 500,000 packages that can be installed via pip. Package authors upload source distributions and wheels to PyPI, making them available to the entire Python ecosystem.
- pytest
- pytest is the most popular testing framework for Python, known for its simple syntax, powerful features, and extensive plugin ecosystem. Unlike the standard library's unittest (which requires classes and specific method names), pytest allows writing tests as plain functions with simple assert statem
- Python
- Python is a high-level, general-purpose programming language emphasizing code readability, simplicity, and developer productivity. Created by Guido van Rossum and first released in 1991, Python uses significant indentation to define code blocks instead of braces or keywords, which enforces a clean,
- Python Community
- The broad ecosystem of users, educators, maintainers, conference organizers, and package authors around Python. In software culture, the Python community is known for accessibility, breadth, and a huge range of practical libraries and learning pathways.
- Python Decorator
- A higher-order function, applied with the @decorator syntax above a function or class definition, that takes the decorated callable as input and returns a modified or wrapped version of it. Decorators are used to add behavior like caching, authentication checks, logging, or retry logic without modif
- Python Generator
- A function that uses the yield keyword to produce a sequence of values lazily, suspending its execution state between each yield and resuming on the next iteration. Generators return an iterator object and consume memory proportional to their state rather than the full sequence length.
- Python Package
- A directory containing Python modules and an __init__.py file (or configured as a namespace package) that groups related code into a single importable unit. Packages can be nested to form hierarchies and are the standard mechanism for organizing and distributing reusable Python code.
- Python Package Index
- The main public repository for Python packages, commonly abbreviated as PyPI. In Python culture, the Python Package Index is a central distribution point that makes sharing and installing libraries straightforward at ecosystem scale.
- Python Virtual Environment
- An isolated Python runtime directory (created via venv or virtualenv) that has its own site-packages, pip binary, and optionally its own Python interpreter symlink. This allows each project to maintain independent dependency versions without polluting the system Python or conflicting with other proj
- PyTorch
- An open-source deep learning framework originally developed by Meta AI that provides tensor computation with GPU acceleration and automatic differentiation via a dynamic computation graph (eager execution by default). It is the dominant framework in ML research and increasingly in production via Tor
- Shallow Copy
- A copy of an object that duplicates the top-level structure but shares references to nested objects with the original, meaning mutations to nested children are visible in both the copy and the source — as opposed to a deep copy, which recursively clones everything.
- SQLAlchemy
- The most widely used Python SQL toolkit and ORM, providing both a low-level Core layer for composing SQL expressions as Python objects and a high-level ORM layer that maps Python classes to database tables. It supports multiple database backends (PostgreSQL, MySQL, SQLite, etc.) through a dialect sy
- Tuple
- A fixed-size, ordered collection of elements where each position can hold a different type. Unlike arrays or lists, tuples are typically immutable and their length and per-position types are known at compile time — making them ideal for returning multiple values from a function or representing heter
- Type Hints
- Optional type annotations in Python (PEP 484) that indicate expected types for function parameters, return values, and variables. Not enforced at runtime but used by type checkers like mypy and IDEs for static analysis.
- Unpacking
- A syntactic feature — called destructuring in JavaScript and unpacking in Python — that extracts individual values from a collection (tuple, list, dict, or object) into separate variables in a single statement. In Python, `a, b, c = [1, 2, 3]` unpacks a list, and `**kwargs` unpacks a dictionary into
- uv Package Manager
- A modern Python package and environment management tool designed for fast installs and streamlined workflows.
- Virtual Environment
- An isolated Python environment with its own packages and interpreter path, preventing dependency conflicts between projects. Created with venv or virtualenv, activated per shell session.
- Wheel
- A pre-built Python package distribution format (.whl) defined in PEP 427 that contains compiled extensions and metadata in a standardized zip archive, enabling pip to install packages without running setup.py or invoking a compiler — significantly faster than installing from source distributions (sd