Open BEEugene opened 3 years ago
its for mypy, my guess is to lint relations while blocking with noqa
I think it's primarily for auto-completion while avoiding circular imports. In the link you provided, from .user import User # noqa: F401
will only import User
for the sake of type checking. It will not execute any code from the .user
module.
Hi!
This is a great template project. Why should we import type_checking in models? from typing import TYPE_CHECKING https://github.com/tiangolo/full-stack-fastapi-postgresql/blob/490c554e23343eec0736b06e59b2108fdd057fdc/%7B%7Bcookiecutter.project_slug%7D%7D/backend/app/app/models/item.py
As far as I understood this import is needed for linter, but how it works? Does it somehow check database consistency?