Bug #1552618: change docs of dict.has_key() to reflect recommendation

to use "in".
This commit is contained in:
Georg Brandl 2006-09-05 12:44:58 +00:00
parent 2cad3e9299
commit c48c9e266f
1 changed files with 5 additions and 5 deletions

View File

@ -1410,15 +1410,15 @@ arbitrary objects):
{(1)}
\lineiii{\var{a}.clear()}{remove all items from \code{a}}{}
\lineiii{\var{a}.copy()}{a (shallow) copy of \code{a}}{}
\lineiii{\var{a}.has_key(\var{k})}
\lineiii{\var{k} in \var{a}}
{\code{True} if \var{a} has a key \var{k}, else \code{False}}
{}
\lineiii{\var{k} \code{in} \var{a}}
{Equivalent to \var{a}.has_key(\var{k})}
{(2)}
\lineiii{\var{k} not in \var{a}}
{Equivalent to \code{not} \var{a}.has_key(\var{k})}
{Equivalent to \code{not} \var{k} in \var{a}}
{(2)}
\lineiii{\var{a}.has_key(\var{k})}
{Equivalent to \var{k} \code{in} \var{a}, use that form in new code}
{}
\lineiii{\var{a}.items()}
{a copy of \var{a}'s list of (\var{key}, \var{value}) pairs}
{(3)}