This post talks about a design practice called Design by Contract (DbC) in Python context, with an example from JAX codebase. I came across this concept in "Clean Code in Python: Develop maintainable and efficient code, 2nd Edition". I find this practice ubiquitous in various open source Python codebases, so I would like to document its principle and try to apply it in the future.
Jun 3, 2022