Building Blocks for Precise & Flexible Type Hints
Actively maintained. Last release 8 weeks ago, commits in 26 of the last 26 weeks. A safe choice.
$
pip install optypeBuilding Blocks for Precise & Flexible Type Hints
Actively maintained. Last release 8 weeks ago, commits in 26 of the last 26 weeks. A safe choice.
pip install optype
Stop fighting your type checker. Work with it.
optype gives you single-method protocols for every dunder,
exact types that reject sneaky subtypes, and typed operators that actually
make sense, so you can express what your code really accepts.
Zero dependencies. Works with every modern type checker. Optional NumPy support included. Battle tested.
Visit the documentation at jorenham.github.io/optype.
Use together with optype: extensions, drivers, servers and companion tools.