[Python] reveal_type in python as of python 3.10 in runtime

Discussão em 'Python' iniciado por Stack, Julho 31, 2025.

  1. Stack

    Stack Membro Participativo

    When using mypy playground, this works fine:

    def f():
    x = 123
    reveal_type(x)


    However, in runtime it generates the error

    NameError: name 'reveal_type' is not defined


    I've seen many discussions as to how to use it, but all of them are old and a bit confusing. What's the way to use reveal_type as of Python 3.10?

    Continue reading...

Compartilhe esta Página