Flake8 complains with 4:5: F401 'pydantic' imported but unused
about this code:
from typing import TYPE_CHECKING, Optional, Type
if TYPE_CHECKING:
import pydantic
def f(*, model: Optional[Type["pydantic.BaseModel"]] = None):
pass
While it's ok with the whole type wrapped into quotes:
def f(*, model: "Optional[Type[pydantic.BaseModel]]" = None):
pass