You're encountering this issue because reveal_type() is not a runtime Python function, it's a static analysis feature used only by type checkers like mypy.
To make your code work, you must run mypy, not python.