Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #80315

Re: Real-world use of Counter

Newsgroups comp.lang.python
Date 2014-11-05 22:00 -0800
References <mailman.15504.1415204817.18130.python-list@python.org>
Message-ID <f28f7279-ac82-4a14-a433-561daec1efb2@googlegroups.com> (permalink)
Subject Re: Real-world use of Counter
From Rustom Mody <rustompmody@gmail.com>

Show all headers | View raw


On Wednesday, November 5, 2014 9:57:08 PM UTC+5:30, Ethan Furman wrote:
> In order to avoid unnecessary code churn (the fix itself is quite simple), the maintainer of the collections module 
> wants to know if anybody has actually been affected by these inconsistencies, and if so, whether it was a minor 
> inconvenience, or a compelling use-case.
> 
> So, if this has bitten you, now is the time to speak up!  :)


Not in direct answer to your specific question, but Counter generally.

In studying (somewhat theoretically) the general world of 
collection data structures we see
- sets  -- neither order nor repetition
- bags  -- no order, repetition significant
- lists -- both order and repetition

Sometimes 'bag' is called 'multiset'
However counter is a weird non-standard name that overloads
an already overloaded term -- 'Counter' has a very standard meaning in programming and in hardware design.

Yes changing the name is too code-churn causing.
But a synonym Bag (or multiset) for Counter would be a pleasant
addition for me.

Calling a bag as counter is inappropriate for an analogous reason
to why calling a dictionary as a 'hash' is inappropriate --
it confuses an implementation detail for fundamental semantics.

--------
PS. I probably wont participate in this discussion hereafter because off-net for 2 weeks

Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Real-world use of Counter Ethan Furman <ethan@stoneleaf.us> - 2014-11-05 08:26 -0800
  Re: Real-world use of Counter Rustom Mody <rustompmody@gmail.com> - 2014-11-05 22:00 -0800
    Re: Real-world use of Counter Ian Kelly <ian.g.kelly@gmail.com> - 2014-11-06 08:51 -0700
    Re: Real-world use of Counter Ian Kelly <ian.g.kelly@gmail.com> - 2014-11-06 22:05 -0700

csiph-web