Hacker News new | past | comments | ask | show | jobs | submit login

The __contains__ does this for you with the more readable 'in' keyword.



That 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.


You can use the values, or items method with in.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: