It’s a wrapper for stuff written in c, right? So they’re trying to prevent segfaults which are less readable
Not C per se, just sometimes cython. I was thinking about this sort of thing, but I just don’t buy it as an objection – even if there are places where things get low level, the checks should only come right before those parts (they are much more frequent than that).
And, more importantly, even if the constraint is “we need data that’s exactly like this, at this point,” there are ways for developers to respond to that constraint other than “insist the user of our API satisfy it themselves, and break if they happen not to.” Like, you can surround your low level code with Python/numpy stuff that intelligently processes it into the required form, to get the behavior expected by Python/numpy users. This can be frustrating to write, sure – it’s similar to what I’m doing to get around sklearn – which I guess might be why it isn’t there?
But also it’s just less frustrating to see this error the first time than scratch your head if the assumptions are violated in some subtle way
That’s what warnings are for!










