These exceptions are probably going to be quite common. I wonder if it is worth making them slightly better by providing some shape information?

I see that they are TypeErrors for consistency, but maybe they should be ValueErrors instead...