beartype enforces type hints. It can be used manually with @beartype
, or at the top of {your_package}.__init__
submodule put
from beartype.claw import beartype_this_package
beartype_this_package()
Code will fail if you pass incorrect types to a function.
beartype integrates with jaxtyping for arrays, pandera for dataframes, and more. Some type hint challenges.