Standard Search
About 14 results
https://rednafi.com/python/variance-of-generic-types/ · 31 Jan 2022
Understand covariance, contravariance, and invariance in Python generics with practical examples of type relationships and subtyping rules.
https://rednafi.com/python/static-typing-decorators/ · 23 Jan 2022
Type Python decorators accurately using ParamSpec and Concatenate to preserve wrapped function signatures and enable proper static analysis.
https://rednafi.com/python/difference-between-typevar-and-union/ · 19 Jan 2022
Understand when to use constrained TypeVar vs Union in Python type hints for consistent types across function parameters and return values.
https://rednafi.com/python/structural-subtyping/ · 4 Dec 2021
Implement Go-style structural subtyping in Python with Protocol for duck typing and interface-based APIs without inheritance dependencies.