Numerary is a Python library that provides a set of type-hinting protocols (e.g., `Integer`, `Float`, `Real`, `Complex`, `Number`) designed for more precise and robust type-checking of numeric types in Python. It is currently at version 0.4.4 and is under active development with frequent, smaller updates.
pip install numeraryVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `numerary` protocols for runtime type checking with `isinstance` and static type hints. The protocols allow distinguishing between different categories of numbers.
Always pin to a specific minor version (e.g., `numerary==0.4.*`) and review release notes for breaking changes before updating.
Understand that `numerary` works with Python's existing type system to add more granular numeric type hints, rather than replacing or altering core numeric behavior.
For strict runtime differentiation between `int` and `float` (e.g., `float` only), prefer `isinstance(value, float)` rather than `isinstance(value, numerary.Float)`.