3 ms·
It's not a lot of magic, but it's pretty opaque magic. The q object overloads the division operator and returns a ? and stores the "passed" value inside itself.
by bastawhiz 3y ago
It's not a lot of magic, but it's pretty opaque magic. The q object overloads the division operator and returns a ? and stores the "passed" value inside itself. The q object extends either a list or a dictionary to act as the set of values to pass to the parametrized query.
So in effect, the slash behavior is just a spicy way to append or set (depending on which dialect option you choose).
- agubelu 3y agoNo, I can see that. It's the same as the logical OR operator | computing unions of sets. I just fail to see how this solution is better than a standard parameterized query, it feels much more opaque without any obvious upsides.