4 ms·
The __contains__ does this for you with the more readable 'in' keyword.
by rjprins 12y ago
The __contains__ does this for you with the more readable 'in' keyword.
- jzwinck 12y agoThat checks whether a key exists. Your parent wants to check whether a value exists. Not that I'm any huge fan of it, considering how it would be inefficient by default.
- dec0dedab0de 12y agoYou can use the values, or items method with in.