You don’t see how type mismatch errors can happen in a dynamically-typed language? Then why do they happen all the time? Hell, I literally had a Python CLI tool crash with a TypeError
last week.
You don’t see how type mismatch errors can happen in a dynamically-typed language? Then why do they happen all the time? Hell, I literally had a Python CLI tool crash with a TypeError
last week.
They’re not wrong. Randomness in computing is what we call “pseudo-random” in that it is deterministic provided that you start from same state or “seed”.
The point of the joke is not that the Python interpreter will change types mid-program on its own, but that you don’t have any real way of knowing if you’re going to get the type you expect.
Programs are messy and complicated, and data might flow through many different systems before finally being used for output. It can and often does happen that one of those systems does not behave as expected, and you get bugs where one type is expected but another is used in actuality.
Yes, most likely what would happen in Python is a
TypeError
, not actual output, but it was pretty clearly minor hyperbole for the sake of the joke.