This won't trigger an error in Python, though. You have to use a type checker like mypy, pyright, or ty to get the warning. But it's a lightweight alternative, and even without tooling, it tells other programmers what parts of the program do what.
oh neat, so basically the NewType thing is a way to be more explicit about what a function is expecting, without needing to spend loads of time defining a dataclass and so on - it's a bit like annotating an existing type like a string, in a way that subsequent functions fo look for