"has" Operator

Skip Montanaro skip at pobox.com
Mon Jul 9 10:33:29 EDT 2001


    Joshua> On the other side of things, it seems this could be introduced
    Joshua> into the language without making 'has' a keyword--no syntactic
    Joshua> rules currently use concatenation.

This is a good point.  I sometimes use this sort of construct:

    has = {"foo":1, "bar":1, ...}.has_key
    ...
    if has(a):
        ...

-- 
Skip Montanaro (skip at pobox.com)
(847)971-7098




More information about the Python-list mailing list