Message31730
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. |
|
Date |
User |
Action |
Args |
2007-08-23 14:52:59 | admin | link | issue1696199 messages |
2007-08-23 14:52:59 | admin | create | |
|