Code inspection broken (type hints) for range()
I am getting broken type hints for many Python types the last two days, most in my codebase, but now builtins are breaking too:
I thought that somehow my code environment was wrong (as clearly typed functions with `-> MyObj`) are interpreted as `-> Any` now), but this is not my code at all.
No shadowing or anything going on. I found one note on SO but resetting my IDE settings had no effect.
Does anyone know what is going on? Using a Python 3.7.9 venv as my interpreter on Windows 10.
Version:
PyCharm 2021.1.1 (Professional Edition)
Build #PY-211.7142.13, built on April 21, 2021
Licensed to *****
Subscription is active until January 23, 2022.
Runtime version: 11.0.10+9-b1341.41 amd64
VM: Dynamic Code Evolution 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 16
Non-Bundled Plugins: CMD Support (1.0.5), com.intellij.plugins.visualstudiokeymap (211.6432.7), org.toml.lang (0.2.146.3826-211), com.koxudaxi.pydantic (0.3.0), ru.meanmail.plugin.requirements (2021.4-211)
Please sign in to leave a comment.
Hi, does it help to delete and re-add the project interpreter? Also please try File | Invalidate Caches / Restart… | Invalidate and Restart
If it doesn't help, could you please provide:
- Screenshot of your interpreter settings, and interpreter paths
- Logs from Help | Collect Logs and Diagnostic Data
Hi Andrey,
Thanks to your questions about the project interpreter I started to dig and I found something that looked off. I have my interpreter junction'ed into the project root, and I also have my virtualenv in the project root. It looks like the combination of these two things caused a lot of issues.
I specifically marked the interpreter directory (python in the below screenshot) as excluded and code completion started to work again.
The only odd thing is that it still marks the interpreter's directory as a "library root" even though it is marked "excluded":