[Python] Unexpected type(s): (int, int) Possible type(s): (SupportsIndex, None) (slice,...

Discussão em 'Python' iniciado por Stack, Agosto 14, 2025.

  1. Stack

    Stack Membro Participativo

    What's wrong with this code:

    split_list = [3600, 3600, 3600, 3600, 3600, 3600, 3600, 3600, 45]
    split_list2 = [None, None, None, None, None, None, None, None, None, None, None, None]
    result = [3600, 3600, 3600, 3600, 3600, 3600, 3600, 3600, 45, None, None, None]

    for i in range(len(split_list)):
    split_list2 = split_list


    In PyCharm it issues a warning;


    Unexpected type(s): (int, int) Possible type(s): (SupportsIndex, None) (slice, Iterable[None])
    ​

    But the script runs just fine and this code works exactly as I expected. I don't like warnings in my IDE though, any quick fixes?

    Continue reading...

Compartilhe esta Página