datajoint-matlab
datajoint-matlab copied to clipboard
Replace the `|` operator with `dj.OrList`
The |
operator is currently used to construct or-lists for restrictions but it is limited to restrictions by relations. In datajoint-python
, we implement the explicit dj.OrList
object. I propose to match the matlab implementation and deprecate the |
operator.
What would be a reason not to support either syntax? Use of |
sounds intuitive compared to having to use dj.OrList
.
The |
operator only works for objects of classes that we define and is therefore limited. dj.OrList
works for any types of restrictors. If dj.OrList
works, then i would rather have one correct way of doing something.
Do we support something like restricting by a cell array?
Yes, an OrList
is any list. So what we really need is an AndList
so that
r & a & b & c
can be expressed as
r & dj.AndList({a b c})
should be implemented with #96