3 ms·
If you add type hints to a function and it detects an error because it's called with the wrong type, it probably didn't work anyway. I've run into that with fu
by Animats 10y ago
If you add type hints to a function and it detects an error because it's called with the wrong type, it probably didn't work anyway.
I've run into that with functions that take NumPy arrays. You can pass a Python array, but "+" behaves very differently. For a NumPy array, it's element by element addition. For a Python array, it's concatenation. You want to catch that.