Decorator which checks whether the function is called with the correct type of parameters
Maintained. Last release 5 weeks ago, commits in 4 of the last 26 weeks. Weaker on commit activity and contributor spread.
pip install strongtypingDecorator which checks whether the function is called with the correct type of parameters
Maintained. Last release 5 weeks ago, commits in 4 of the last 26 weeks. Weaker on commit activity and contributor spread.
pip install strongtypingmypyc is used to compile the core logic code.Use the dedicated a_match_typing decorator for async def functions. It preserves the coroutine interface while
validating annotated arguments before the function runs.
from strongtyping.astrong_typing import a_match_typing
import asyncio
@a_match_typing
async def add(left: int, right: int) -> int:
return left + right
async def main() -> None:
result = await add(1, 2) # 3
await add(1, "2") # raises TypeMismatch
asyncio.run(main())
See the async type checking documentation for configuration options and further examples.
This library includes Agent Skills for AI coding assistants (like Claude Code, Cursor, and
GitHub Copilot). These skills provide the AI with specialized knowledge on how to apply runtime type checking, handle
TypeMismatch exceptions, and follow best practices when using strongtyping in your codebase.
You can validate the skills by running:
pytest tests/test_skills.py
Use instead of strongtyping: tools that do the same job, closest first.
Compare with typeguard →Compare with runtime-type-checker →Compare with beartype →Compare all 4 →
Run-time type checker for Python
Runtime-type-checker performs type check at runtime with help of type annotations
Unbearably fast near-real-time pure-Python runtime-static type-checker.
A library to perform runtime validation of Python objects using type hints.
A dependency free type enforcer for python type annotations
The module, which allows easily validate function's input/output values.