Two additional things beyond the important lesson to always time things:

1. Be careful with operator precedence. In this case, people got lucky:

    not b in m

has the precedence:

    not (b in m)

2. Python has a "not in" operator:

    b not in m

which is the clearest and fastest way to test for non-membership in a
container.

Tim Delaney
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to