Ah of course. Sorry, misunderstood the context. I think you should make `hinge_loss` raise `ValueError`, not `TypeError` in this case.