Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
aptwebapps
· 12y ago · 0 comments
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.
Comments
[–]
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.