This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bethard
Recipients
Date 2007-04-19.15:15:06
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
A summary of the python-dev thread (http://mail.python.org/pipermail/python-dev/2007-April/072502.html)

Since the number of times an unseen item was seen is 0, most people felt returning 0 was more natural behavior than raising KeyError.

There was some discussion of alternate names, but most people were fine with counts().

Raymond suggested making it a classmethod of dict, but people were a little concerned about adding to dict's already complex API, and since the result of counts() needed to return 0s instead of raising KeyErrors, it wouldn't really have the same behavior as a plain dict() anyway.
History
Date User Action Args
2007-08-23 14:52:59adminlinkissue1696199 messages
2007-08-23 14:52:59admincreate