Python typing strategy

Python 3.5+ offers support for type hints.

Our current strategy (as of September 2020) is to add type hints to new classes, methods and functions in the digitalmarketplace-utils repo, with a view to potentially expanding this into our other versioned libraries (such as the API client or Content Loader).

Existing code doesn’t have to be updated, unless it makes sense as part of the work you’re currently doing. If you do add type hints for existing code, keep this in a separate commit, to assist the code reviewer.

See dmutils/forms/errors.py for an example of how we use type hints.