Author bethard
Date 2007-04-19.15:15:06
SpamBayes Score
Marked as misclassified
A summary of the python-dev thread (

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.
Date User Action Args
2007-08-23 14:52:59adminlinkissue1696199 messages
2007-08-23 14:52:59admincreate