I started an experimental mypy plugin at Draft: Add plugin for type checking with mypy (!2352) · Merge requests · Tryton / Tryton · GitLab
For now it inject the “parent” classes for classes with metaclass as PoolMeta (for now only for the hard coded party.party in party_siret module). But it works as it can detect “undefined in superclass” and “Missing positional argument” for inherited method.
The next points are:
- find classes to inject for a tryton name and module
- find a fix for the
Model.__getattr__(probably remove it from the definition) - get a way to type using model that are not in the module
- hook
Pool.getto return the proper type