Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
mjburgess
· 12y ago · 0 comments
better just to have and __in__ no?
Comments
[–]
aptwebapps
12y 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
12y ago
the `in` keyword uses `__contains__` under the hood, if I remember correctly, so you could always make a `dict` subclass that provides this functionality.