3 ms·
better just to have and __in__ no?
by mjburgess 13y ago
better just to have and __in__ no?
- aptwebapps 13y agoYou 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.