3 ms·
The parent meant statically typed. Meaning it shows the errors at compile time. Yes, you can check at runtime, the problem though is that especially on Python
by takeda 6y ago
The parent meant statically typed. Meaning it shows the errors at compile time.
Yes, you can check at runtime, the problem though is that especially on Python 2. Those checks don't happen very often.
Python 3 though will crash if you try to use bytes as text or vice versa. The python 2 though it will do an implicit casting and execute code, which will run and look like it runs correctly until you get an unicode characters, then it will crash.
Java won't even let you compile such program. You could get somewhat similar protection if you annotate types and use mypy to check them.