4 ms·
My question is, why? If one wanted this type of guarantee consistently, they might as well use a statically typed language. Add: To clarify, the error shows up
by jeswin 11y ago
My question is, why? If one wanted this type of guarantee consistently, they might as well use a statically typed language.
Add: To clarify, the error shows up at runtime in Python. So you're going to need tests anyway. Just as in JS.
Btw (unrelated), you can do the same thing in JS as well
[a, b, ...rest] = [1, 2, 3, 4, 5]
- deleted 11y ago[deleted]