dedupe the $in operator

Just a suggestion. It uses a set and therefore doesn't work with unhashable types (e.g. dicts). @thomasst what do you think about it?