[Python] Unable to imply list/tuple by using `[int, str]` in place of `list[int, str]` for...

Discussão em 'Python' iniciado por Stack, Maio 27, 2025.

  1. Stack

    Stack Membro Participativo

    All throughout my code I've been using type annotations like so without any problems:

    • [int]: list of integers
    • list[int | str]: list where each item is an integer or string
    • [int, string]: a list or tuple with two items, an integer and a string.

    However, ever since PyCharm 2025.1.1.1 was broken and I installed the Pycharm 2025.1.2 Release Candidate, the inspection behavior has changed and there is no implied list or tuple.

    I can believe that some of my type annotations aren't correct, but I'm sure I would have noticed before now if I was doing it wrong everywhere.

    I don't believe I lost any PyCharm plugins, and it's the same Python version (3.11).

    Continue reading...

Compartilhe esta Página