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