PrivateStorageio / ZKAPAuthorizer

a Tahoe-LAFS storage-system plugin which authorizes storage operations based on privacy-respecting tokens
10 stars 7 forks source link

Pass `mypy --strict` without `cast`, `type: ignore`, or features disabled in the configuration file #426

Open exarkun opened 2 years ago

exarkun commented 2 years ago

This is an umbrella ticket. Specific self-consistent steps towards this goal can be described in new tickets and resolved independent.

ZKAPAuthorizer now has many type annotations. Internally, much of it passes mypy --strict. However, the codebase:

Each of these work-arounds compromises the value of the static checker to some degree. The fewer work-arounds, the better. When there are zero work-arounds then the static checker should provide a fairly strong guarantee that the codebase actually makes sense at some level (at the type level). This doesn't guarantee the codebase makes sense at the higher level of "satisfies the requirements" but it is a necessary precondition to achieve that.

The reality of static checking in Python might mean that we never get all the way to zero work-arounds but it's a good target to aim at for the time being.