[issue11733] Implement a `Counter.elements_count` method

2011-04-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: After more thought, I've decided to close this feature request. The operation is utterly trivial and isn't worth fattening the API. I see no advantage in `c.total_count()` versus `sum(c.values())`. -- resolution: -> rejected status: open -> clos

[issue11733] Implement a `Counter.elements_count` method

2011-04-01 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue11733] Implement a `Counter.elements_count` method

2011-03-31 Thread Matthew Barnett
Matthew Barnett added the comment: The name isn't meaningful to me. My preference would be for something like "total_count". -- nosy: +mrabarnett ___ Python tracker ___ ___

[issue11733] Implement a `Counter.elements_count` method

2011-03-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: > It would be interesting to have Counter.elements_count() > if it has a complexity of O(1): if the collections > maintains a total (in a private attribute). I agree that it would be interesting; however, it would be an implementation disaster. We would

[issue11733] Implement a `Counter.elements_count` method

2011-03-31 Thread STINNER Victor
STINNER Victor added the comment: It would be interesting to have Counter.elements_count() if it has a complexity of O(1): if the collections maintains a total (in a private attribute). Otherwise, I think that sum(c.values()) is enough and can be documented as an example in the Counter doc.

[issue11733] Implement a `Counter.elements_count` method

2011-03-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the feature request. Py3.3 is a long ways away, so I'll leave this open for a while. Comments in favor: * Precedent with Smalltalk bags that know their total length Comments against: * sum(c.values()) is trivial to write * fattening the API mak

[issue11733] Implement a `Counter.elements_count` method

2011-03-31 Thread Ram Rachum
New submission from Ram Rachum : I suggest a `Counter.elements_count()` method should be added, that would give the same answer as `sum(counter.itervalues())`. -- components: Library (Lib) messages: 132708 nosy: cool-RR, rhettinger priority: normal severity: normal status: open type: fe