Julia uses types as compiler hints. If you dispatch f(x) as f(1.0), in most cases it will lazily compile f to be float-optimized. When you run f(1) it will recompile it to be integer optimized.
This enables you to also select libraries: a standard float type will use blas for matrix ops; a gpu float type will use cuda.
Mypy types don't usually have any runtime enforcement.