Message167605
| Author |
mark.dickinson |
| Recipients |
mark.dickinson, meador.inge, rhettinger, slwebber |
| Date |
2012年08月07日.07:15:24 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1344323726.48.0.998130641105.issue14182@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> Raymond, Stephen's analysis seems correct. Are we missing something or
> can this issue be closed?
Well, depending on how you think about Counters, the current behaviour of equality definitely leads to some surprises. For example:
>>> Counter(a = 3) + Counter(b = 0) == Counter(a = 3, b = 0)
False
OTOH, if we're consistent about regarding a count of 0 as 'equivalent' to a missing element, then __nonzero__ / __bool__ probably needs changing, too.
>>> c = Counter(a = 0)
>>> bool(c)
True
>>> bool(c + c)
False |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年08月07日 07:15:26 | mark.dickinson | set | recipients:
+ mark.dickinson, rhettinger, meador.inge, slwebber |
| 2012年08月07日 07:15:26 | mark.dickinson | set | messageid: <1344323726.48.0.998130641105.issue14182@psf.upfronthosting.co.za> |
| 2012年08月07日 07:15:25 | mark.dickinson | link | issue14182 messages |
| 2012年08月07日 07:15:25 | mark.dickinson | create |
|