Files
ormar/docs/mypy.md
2020-11-01 11:41:18 +01:00

718 B

To provide better errors check you should use mypy with pydantic plugin

Note that legacy model declaration type will raise static type analyzers errors.

So you cannot use the old notation like this:

--8<-- "../docs_src/models/docs011.py"

Instead switch to notation introduced in version 0.4.0.

--8<-- "../docs_src/models/docs012.py"

Note that above example is not using the type hints, so further operations with mypy might fail, depending on the context.

Preferred notation should look liked this:

--8<-- "../docs_src/models/docs001.py"