3 ms·
Most of the bugs I got on numpy programs came from a variable with a different ndims as expected being broadcast implicitly. Implicit type casting is considere
by mFixman 2y ago
Most of the bugs I got on numpy programs came from a variable with a different ndims as expected being broadcast implicitly.
Implicit type casting is considered a mistake in most programming languages; if I were to redesign numpy from scratch I would make all broadcasting explicit.
My solution to these problems is asserting an array's shape often. Does anybody know is there's a tool like mypy or valgrind, but that checks mismatched array shapes rather than types or memory leaks?