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`.

0

Might be related to this issue

Could you please share a full code snippet so we can check it? 

0

I also have the same issue.

0
Do you have an unexcluded venv directory in the project?
0

Yes, that was the problem.  I excluded the venv directory and the type warnings went away.  Thanks!

0

Confirm that excluding venv dir solves the issue. Thanks!

0

“ I excluded the venv directory and the type warnings went away”
Why does this solve the problem?

0

Hi Gadjimuradovmm , this is a known issue. Please check PY-63456 for details. I will go ahead and mark this thread as resolved.

0

请先登录再写评论。