[Python] Why there is an unbound variable error warning by pyright in this simple python...

Discussão em 'Python' iniciado por Stack, Fevereiro 9, 2025.

  1. Stack

    Stack Membro Participativo

    In VSCode, which uses pylance/pyright, gives me the warning/hint for a being possibly unbound. Why is this? How do I fix it?

    def f():
    for i in range(4):
    a = 1
    print(a)

    return a

    Continue reading...

Compartilhe esta Página