github snok/flake8-type-checking v1.2.0

latest releases: v2.4.1, v2.4.0, v2.3.1...
2 years ago

Features

  • Added Pydantic support (#58)

    For a quick summary of why Pydantic needs support in the first place: unlike most Python libraries, Pydantic evaluates annotations defined on their models at runtime. At the same time, this plugin is built on the assumption that imports which are only found in annotation slots, are not required at runtime. To make this work, we have added a --type-checking-pydantic-enabled option which, when toggled on, will treat all annotations from class variable annotations as required at runtime.

    This will lead to some false positives, e.g., for dataclass annotations, but in this case false positives are inconsequential and false negatives lead to runtime errors in prod, so better to favour the former in this case.

Fixes

  • Fixed end_lineno inference for __all__ assignments (#59)

Don't miss a new flake8-type-checking release

NewReleases is sending notifications on new releases.