3 ms·
I don't think this example has anything to do with "stronger typing". A Tuple<Tuple<int, int>, Tuple<int, int>> would have passed the type check just fine the s
by nlitened 5y ago
I don't think this example has anything to do with "stronger typing". A Tuple<Tuple<int, int>, Tuple<int, int>> would have passed the type check just fine the same way, without revealing your error.
- tirpen 5y ago> I don't think this example has anything to do with "stronger typing". I disagree. There are definitely languages where you could easily differentiate between a "length-int" and a "coordinate-int" in the type system, while still representing it as only an int in memory at runtime. I belive both Haskell and Ada can do this for instance.
- dragonwriter 5y ago> There are definitely languages where you could easily differentiate between a "length-int" and a "coordinate-int" in the type system Python, via the shared portion of the type system enforced by the major type checkers, is one of those languages. The fact that a particular library doesn't choose to do this doesn't mean the type system doesn't fully support it.