General Tech

Show HN: Gawain – Require type hints on all Python variables

Gawain is a tool that requires type annotations on all Python variables, parameters, returns, and class attributes, then runs a type checker to ensure the types are correct. It's designed to enforce type annotations on all variables, not just function parameters, and can use either ty or pyrefly as the type checker. The tool is available on GitHub and can be installed using pip. It's recommended to use it with care, as ty is in beta and its diagnostics may change between versions.

Read the full article at github.com →