3 ms·
Python doesn't do runtime type checking (especially internal ranges) and never will. It does find the error at the first invalid operation, just not as early a
by mixmastamyk 2y ago
Python doesn't do runtime type checking (especially internal ranges) and never will. It does find the error at the first invalid operation, just not as early as you'd like perhaps.
If this is a non-theoretical problem at your end, a stricter language might well be called for.
- deathanatos 2y ago> Python doesn't do runtime type checking I don't know what you're defining "runtime type checking" as, but it absolutely does. You can't stuff a bool into an int, you can't stuff any arbitrary byte into a str. For the most part, it's strongly typed, but str falls down by allowing non-Unicode values into its set of values. > If this is a non-theoretical problem at your end, a stricter language might well be called for. … Python is plenty well suited to the task, if not for bugs in the implementations of its types.