dictionaries and 'in' in 2.1

Tim Peters tim.one at home.com
Sun Nov 4 04:17:07 CET 2001


[John J. Lee]
> The Python 2.1.1 manual, section 2.1.6, says:
>
>   k in a        1 if a has a key k, else 0
> k not in a      0 if a has a key k, else 1

These are new-in-2.2 features.  They got documented "early" by mistake.  The
2.1.2 docs will repair this.  Use a.has_key() before 2.2.





More information about the Python-list mailing list