LGTM.com - false positive when using imports with TYPE_CHECKING
Abierto
false-positive
Python
- Lenguaje dominante
- CodeQL
- Estrellas
- 10.1k
- Forks
- 2.1k
- Merge medio
- 2 d 15 h
- PR fusionados (30 d)
- 141
Descripción
**Description of the false positive**
lgtm complains that a "Module is imported more than once" in my python code, but the first import ist protected by "if TYPE_CHECKING:", which is required for mypy type checking to work properly. I think lgtm should simply ignore imports that are under `TYPE_CHECKING`.
**URL to the alert on the project page on LGTM.com**
Here is the concrete error:
https://lgtm.com/projects/g/zwicker-group/py-pde/snapshot/67363039e04aebcfba93b01fcf65014bec37aebb/files/pde/tools/plotting.py?sort=name&dir=ASC&mode=heatmap#x70f271ca0359e14c:1
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.