D'Arcy J.M. Cain wrote:
On Thu, 30 Oct 2008 09:50:57 -0500
"Kurt Smith" <[EMAIL PROTECTED]> wrote:
2.5 docs say that:
 "a.has_key(k) Equivalent to k in a, use that form in new code"
Meaning: don't use 'a.has_key(k)'.

2.6 docs say that:
 "dict.has_key(key) is equivalent to key in d, but deprecated."
Meaning, 'd.has_key(key)' is deprecated -- use 'key in d'.

Wow!  That is so badly written.  Both those statements could easily be
read the opposite by someone reading the docs.  Granted the latter is
better and it is correct but it could be clearer the the user.  It
should be something like;

  """dict.has_key(key) is deprecated.  Use "key in dict" instead."""

IOW your explanation of the sentence is better than the sentence.  :-)

http://bugs.python.org/issue4243

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

Reply via email to