4 ms·
You can already do: 'a' in {'a':1} which will evaluate True. But that's for keys. GP post wants to know about values, if I understand properly.
by aptwebapps 13y ago
You can already do:
'a' in {'a':1}
which will evaluate True. But that's for keys. GP post wants to know about values, if I understand properly.
- untothebreach 13y agothe `in` keyword uses `__contains__` under the hood, if I remember correctly, so you could always make a `dict` subclass that provides this functionality.