"has" Operator

Aahz Maruch aahz at panix.com
Mon Jul 9 18:52:34 CEST 2001

In article <mailman.994689256.3553.python-list at python.org>,
Skip Montanaro  <skip at pobox.com> wrote:
>    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):
>        ...

Woah!  That's s[l]ick!
                      --- Aahz  <*>  (Copyright 2001 by aahz at pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista   

"How come we choose from just two people for President but more than 50
for Miss America?"  --AEN

More information about the Python-list mailing list