A runtime type-checking decorator for Python functions.
git clone https://github.com/GijsPeletier/type-check.git
cd type-check
pip install -e .from type_check import type_check
@type_check
def add(a: int, b: int) -> int:
return a + b
add(1, 2) # -> 3
add(1, "2") # TypeError: argument 'b' is not the right type
# (is 'str', should be 'int')Works with union types, Generic type hints, *args, **kwargs, and string annotations.