{"id":22416,"library":"strongtyping","title":"strongtyping","description":"A Python library providing decorators for runtime type checking of function parameters and return values, supporting TypedDict, Annotated, and custom validators. Current version 3.13.6, requires Python >=3.13. Release cadence is irregular, with frequent minor version bumps.","status":"active","version":"3.13.6","language":"python","source_language":"en","source_url":"https://github.com/FelixTheC/strongtyping","tags":["type-checking","runtime","decorator","typing","validation"],"install":[{"cmd":"pip install strongtyping","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"The decorator is in the strong_typing submodule, not top-level.","wrong":"from strongtyping import strong_typing","symbol":"strong_typing","correct":"from strongtyping.strong_typing import strong_typing"},{"note":"match_typing is also in the strong_typing submodule.","wrong":"from strongtyping import match_typing","symbol":"match_typing","correct":"from strongtyping.strong_typing import match_typing"},{"note":"Exception is importable from top-level.","wrong":"","symbol":"TypeMisMatch","correct":"from strongtyping import TypeMisMatch"}],"quickstart":{"code":"from strongtyping.strong_typing import strong_typing\n\n@strong_typing\ndef greet(name: str) -> str:\n    return f\"Hello {name}\"\n\nprint(greet(\"World\"))\n# print(greet(42))  # raises TypeMisMatch","lang":"python","description":"Basic runtime type checking with the strong_typing decorator."},"warnings":[{"fix":"Upgrade Python to >=3.13 or use strongtyping <3.13.0 for older Python.","message":"Python 3.13 or higher is required. The library dropped support for earlier Python versions in v3.13.0.","severity":"breaking","affected_versions":">=3.13.0"},{"fix":"Use 'TypeMismatch' instead of 'TypeMisMatch' if available.","message":"The old 'TypeMisMatch' class name (capital M) is deprecated in favor of 'TypeMismatch' (lowercase m) in recent versions.","severity":"deprecated","affected_versions":"<3.13.0?"},{"fix":"Import types from typing (e.g., from typing import List) and annotate with List[int].","message":"The decorators do not work with built-in typing generics like List[int] if the type is not imported from typing. Use the typing module types (e.g., typing.List) rather than built-in list subclassing.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use: from strongtyping.strong_typing import strong_typing","cause":"Importing from the incorrect module path.","error":"ImportError: cannot import name 'strong_typing' from 'strongtyping'"},{"fix":"Use Union[int, str] from typing instead, or upgrade Python to >=3.10.","cause":"Using PEP 604 union syntax (e.g., int | str) in Python <3.10, which strongtyping v3.13.2+ supports but requires Python 3.10+ for that syntax.","error":"TypeError: unsupported operand type(s) for |: 'type' and 'type'"},{"fix":"Correct the argument type to match the annotation.","cause":"Standard runtime type mismatch error raised by the decorator.","error":"TypeMisMatch: Expected '<class 'int'>' but got '<class 'str'>'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}