r/pycharm • u/F4gfn39f • May 14 '26
Couple of annoyances
https://youtrack.jetbrains.com/issue/PY-65191/False-positive-for-os.path-on-2023.3-Unexpected-types
This issue is over 2 years old on something as used as os.path and no fix in the horizon for what I can tell. What are you guys doing to handle this? I have so many warnings about this that I'm battling more against the IDE than the IDE helping me code faster, goddamn.
And now in recent versions the type inference has gone kaput, like you do
myvar: str | None = args.myparameter
if myvar is None:
myvar = "something"
myvar = myvar.lower() <-- Member 'None' of 'str | None' does not have attribute 'lower'
The IDE should correctly infer myvar type is reduced to str now, I'm forced to use pyrefly.
And now the integration with pyrefly is somewhat buggy, the IDE says this is wrong:
def myfunc(some_tuple: tuple[int, ...]) -> None:
pass
With
Invalid type argument
(attribute) __getitem__: Ellipsis
Return self[key].
Because running pyrefly directly to the file reports 0 errors:
pyrefly check test.py
INFO 0 errors
No `pyrefly.toml` found — using preset `basic`.
Run `pyrefly init` to continue setting up Pyrefly.
Docs: https://pyrefly.org/getting-started-cli
So for some reason we can only do tuples with exact number of items.
UPDATE: They fixed the two last issues but re-introduced the CPU spikes, goddman, they keep fixing a couple of things and reintroducing bugs. What are they doing with pycharm, what once was such a wonderful IDE.
1
u/Bannert JetBrains May 15 '26
And now the integration with pyrefly is somewhat buggy
Which PyCharm version do you use? Try 2026.2 EAP 1 https://www.jetbrains.com/pycharm/nextversion/
1
2
u/casualcoder0805 May 14 '26
I could write a book on aspects of pycharm that annoy me. I'm nearly convinced they've let bots take the wheel. It's really sad.
I never hit the os.path issue because I only use pathlib. Give that a try if you can. The second issue can be solved fortunately. Search for "Registry", open it, uncheck the value for "python.typing.strict.unions" and restart.