Python ParamSpec guide
A guide to using Python's ParamSpec (PEP 612) for correctly typing decorators that modify function signatures, with examples.
Nikita Sobolev is a CTO, founder of wemake.services, and open-source advocate who works across Python, Elixir, and TypeScript, sharing expertise in software architecture, product development, and sustainable open-source practices.
10 articles from this blog
A guide to using Python's ParamSpec (PEP 612) for correctly typing decorators that modify function signatures, with examples.
Introduces typeclasses in Python as a solution for writing functions that behave differently for different types, using the dry-python library.
Proposes making tests a reusable part of Python applications, using Django and deal library examples to illustrate sharing test logic.
Explains Higher Kinded Types (HKTs) in Python, their implementation, and how to use them via the dry-python/returns library.
A critique of async/await implementation in programming languages, focusing on code duplication and proposing functional abstractions as an alternative.
Critiques common logging practices in software development, arguing for alternatives like type safety, error monitoring services, and business metrics.
Explores the challenge of achieving 100% test coverage for Python code that must handle version-specific logic and compatibility layers.
Explains how to implement typed functional dependency injection in Python, contrasting it with traditional OO DI and using a Django example.
Explores how code complexity creeps into projects and offers automated strategies to detect and prevent it, promoting continuous refactoring.
A post-mortem analysis of a production outage caused by a broken Django migration, and the introduction of django-test-migrations for safer database changes.