Given this scenario:
b.py:
import A
# A is unused here
c.py:
from b import A
# A is used here
PyCharm complains in b.py that "import A" is an unused import and Optimize imports deletes it, breaking import in c.py
I know these chained imports are not a good practice (although you may use it to implement a facade module), but is it me or is it a PyCharm fail?
You can actually use the PyUnresolvedReferences
marker to deactivate the inspection for your import statement:
# noinspection PyUnresolvedReferences
import A
Reference: PyCharm bug PY-2240