Description of the false positive
Type hints require types to be imported at validation-time. If type relations are cyclic, TYPE_CHECKING is recommended to remove cyclic imports at runtime. If type relations are forward referencing, type hints must be quoted (i.e. strings).
LGTM does not understand this usage. It reports
- cyclic imports (even though guarded by
TYPE_CHECKING), and
- unused imports (even though used in type hints).
URL to the alert on the project page on LGTM.com
Cyclic import: https://lgtm.com/projects/g/MaineKuehn/usim/snapshot/6271704950fe0c34caee96eaf4cc37129fc13261/files/usim/_primitives/context.py?sort=name&dir=ASC&mode=heatmap#xce210d3cac0e2d3d:1
Unused import: https://lgtm.com/projects/g/MaineKuehn/usim/snapshot/6271704950fe0c34caee96eaf4cc37129fc13261/files/usim/_primitives/task.py?sort=name&dir=ASC&mode=heatmap#xc0feb80fd994c19a:1
Description of the false positive
Type hints require types to be imported at validation-time. If type relations are cyclic,
TYPE_CHECKINGis recommended to remove cyclic imports at runtime. If type relations are forward referencing, type hints must be quoted (i.e. strings).LGTM does not understand this usage. It reports
TYPE_CHECKING), andURL to the alert on the project page on LGTM.com
Cyclic import: https://lgtm.com/projects/g/MaineKuehn/usim/snapshot/6271704950fe0c34caee96eaf4cc37129fc13261/files/usim/_primitives/context.py?sort=name&dir=ASC&mode=heatmap#xce210d3cac0e2d3d:1
Unused import: https://lgtm.com/projects/g/MaineKuehn/usim/snapshot/6271704950fe0c34caee96eaf4cc37129fc13261/files/usim/_primitives/task.py?sort=name&dir=ASC&mode=heatmap#xc0feb80fd994c19a:1