GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
The __contains__ method is written to be used for a single array element. However for example in list of list, __contains__ does a check more equivalent to subarrays. in must return a single boolean. After some discussion on the list, there are three main possibilities:
a in b
Point 2. seems wrong, since arrays are not list of lists. Point 3. has some merit, it can go as far as allowing things similar to strings 'a' in 'cat', however there are some problems with the details. Point 1. is the simplest and safest solution. One problem with 2. is that for object arrays it can be not quite clear how to interpret for example a tuple/list.
'a' in 'cat'
At this time (there was not much discussion yet though), it seems that the best solution is to just raise an error (i.e. solution 1.). Finding subarrays is better suited for a dedicated function.
This might be worth raising on the list.