Unexpected type(s):(int)Possible type(s):(SupportsIndex)(slice) with PyCharm 2024.3
已回答
Since upgrading to PyCharm 2024.3, I've started to get these errors in my code.
Unexpected type(s):(int)Possible type(s):(SupportsIndex)(slice)
They occur for expressions like foo.bar[0].text, with the error highlighted on `0`.
请先登录再写评论。
Might be related to this issue.
Could you please share a full code snippet so we can check it?
I also have the same issue.
Yes, that was the problem. I excluded the venv directory and the type warnings went away. Thanks!
Confirm that excluding venv dir solves the issue. Thanks!
“ I excluded the venv directory and the type warnings went away”
Why does this solve the problem?
Hi Gadjimuradovmm , this is a known issue. Please check PY-63456 for details. I will go ahead and mark this thread as resolved.