Skip to content

Type annotations in metadata mappings

Lucifer Morningstar requested to merge generated-differential-D7342-source into master

Add type annotations to metadata mappings (#2259)

This patch adds type annotations to metadata mappings so that the mypy type checker can detect bugs in code. While working on the path, I also encountered these issues:

  1. mypy raises error on detecting for implicit None returns, so I had to add return None at many places.

  2. At a few places, @property s' are accessed using cls. mypy rightfully raises an error, so I had to add ignore to silence it for now. It appears Python 3.9+ supports class level properties so the ignores could be replaced by the proper handling when the minimum python version is raised.

Closes #2259.


Migrated from D7342 (view on Phabricator)

Merge request reports