4 ms·
I've worked with numpy for years and I don't think I ever used the 'in' operator with arrays. What would be the use case for that? For me a larger gotcha was ar
by ThePhysicist 4y ago
I've worked with numpy for years and I don't think I ever used the 'in' operator with arrays. What would be the use case for that? For me a larger gotcha was around object multiplication (i.e. element-wise vs. matrix multiplication) and how it is different based on whether you have a "matrix" or an "array" type (or a mix of both). That caused some pretty big headache in the beginning.
- weare138 4y agoBut that just seems like a foot gun for the poor unfortunate soul that eventually does.
- rowanG077 4y agoI don't think people who use python are concerned with footguns. Numpy is very much not at fault here.
- DangitBobby 4y agoWhy would you think that?
- rowanG077 4y agoBecause the typing system used in Python is a big footgun. If the basis of the language you are using encourages footguns then it's not surprising that a large library in that ecosystem doesn't care about that either.
- sillysaurusx 4y agoMeh. Footguns are underrated. Let’s return to the Wild West of the 90s. I’m only partially joking. But this was one case where they probably thought it was a good idea, turned out to be a bad idea, then couldn’t turn it off without breaking a bunch of code.
- rightbyte 4y agoAll these talk about code safety just want me to stop wearing my bike helmet. For most of my programs safety is of zero concern. I'll trade it for convenience any day. Just let me implicit cast signed to unsigned thank you very much.
- __del__ 4y agoiirc matrix is deprecated