[Python-Dev] dict containment annoyance
Jean-Paul Calderone
exarkun at divmod.com
Sat Aug 12 19:07:52 CEST 2006
On Sat, 12 Aug 2006 18:57:02 +0200, tomer filiba <tomerfiliba at gmail.com> wrote:
>
>the logic is simple: every `x` is either contained in `y` or not.
>if `x` *cannot* be contained in `y`, then the answer is a "strong no",
>but that's still a "no".
>
def blacklisted(o):
try:
# Is the object contained in the blacklist set?
return o in _blacklistset
except TypeError:
# If it *cannot* be contained in the blacklist set,
# then it probably isn't.
return False
Jean-Paul
More information about the Python-Dev
mailing list