Python terms
Readable, versatile, and the language of modern data science
Python's combination of readable syntax, vast ecosystem, and first-class support for data science, ML, and automation has made it one of the world's most-used languages. This category covers Python idioms, the data model, async patterns, packaging, performance considerations, and the standard library features that make Python code elegant rather than merely functional.
__slots__ & Memory Optimisation Python 3.0+
Declaring __slots__ on a class prevents the dynamic __dict__ per instance — reducing memory usage by 40-60% for classes with many instances.
2mo ago
python intermediate
CLI Tools with argparse & Click Python 3.6+
Building Python command-line tools — argparse (stdlib) for simple tools, Click (decorator-based) for complex CLIs with subcommands, type coercion, and better help formatting.
2mo ago
python intermediate
Python Packaging Python 3.7+
pyproject.toml with Poetry or PDM replaces setup.py and requirements.txt — providing locked, reproducible, separated dev/prod dependencies like composer.lock.
2mo ago
python intermediate
Structural Subtyping with Protocol Python 3.8+
Protocol classes define structural interfaces — any class with matching methods satisfies the protocol without explicit inheritance (type-safe duck typing).
2mo ago
python intermediate
Walrus Operator (:=) Python 3.8+
The assignment expression operator (Python 3.8+) — assigns a value while also using it in an expression, eliminating repeated computations in while loops and comprehensions.
2mo ago
python intermediate
Advanced Context Managers Python 3.1+
Context managers (with statements) manage resource acquisition and release — contextlib provides tools for creating them without a full class definition.
2mo ago
python intermediate
Advanced Python Dataclasses Python 3.7+
Dataclasses auto-generate __init__, __repr__, __eq__ from field declarations — advanced features include frozen (immutable), slots (memory-efficient), and field metadata.
2mo ago
python intermediate
The with statement guarantees __exit__ runs even on exception — used for file handles, locks, transactions, and any resource needing cleanup.
2mo ago
python intermediate
Pydantic Python 3.8+
A Python library for data validation using type annotations — defining models as classes with typed fields that validate and coerce input data at runtime.
2mo ago
python intermediate
Python's native async framework — coroutines, event loop, and asyncio — for concurrent I/O without threads.
2mo ago
python intermediate
Python Dataclasses & Pydantic Python 3.7+
@dataclass auto-generates __init__, __repr__, __eq__; Pydantic adds runtime validation and serialisation — Python's equivalent of typed DTOs.
2mo ago
python intermediate
Functions that wrap other functions to add behaviour — @cache, @dataclass, @property — applied at definition time with the @ syntax.
2mo ago
python intermediate
Python Error Handling Python 2.0+
Python uses try/except/else/finally blocks and a rich exception hierarchy — good error handling is specific, informative, and never silently swallows exceptions.
2mo ago
python intermediate
Python Generators & yield Python 2.2+
Functions that yield values one at a time — enabling lazy evaluation of infinite sequences without storing all values in memory.
2mo ago
python intermediate
Python Logging Python 3.0+
Python's built-in logging module provides a structured, configurable way to emit log messages at different severity levels — replacing print() for production code.
2mo ago
python intermediate
Python Pattern Matching (match/case) Python 3.10+
Python 3.10+ structural pattern matching — more powerful than switch/case, matching values, types, sequences, mappings, and class attributes in a single readable construct.
2mo ago
python intermediate
Python Type Hints & mypy Python 3.5+
Optional static type annotations — def greet(name: str) -> str — checked by mypy and IDEs at analysis time, ignored at runtime.
2mo ago
python intermediate
Testing with pytest Python 3.6+
pytest is Python's dominant testing framework — its fixture system, parametrize decorator, and plugin ecosystem make it more powerful and less verbose than unittest.
2mo ago
python intermediate