On Thu, 22 Jan 2009 10:11:37 -0800 (PST)
Raymond Hettinger pyt...@rcn.com wrote:
The collections module in Python 2.7 and Python 3.1 has gotten a new
Counter class that works like bags and multisets in other languages.
I like that! Now that we have a multiset or Counter I think a
redefinition
msrache...@gmail.com writes:
how do you guys like the functionality? Do you find it useable in
real-world use cases?
It's interesting. I wouldn't have thought of that API--I'm used to
populating defaultdict(int) in the obvious ways for this sort of
thing--but it is attractive and I think it
Raymond Hettinger:
The collections module in Python 2.7 and Python 3.1 has gotten a new
Counter class that works like bags and multisets in other languages.
Very nice. Python std lib is growing more data structures, increasing
the power of a default Python installation. I can remove more and
bearophile:
Are keys restricted to be long and int values only? Or are they
general (referenced) objects + a control of their integral nature?
Here I meant values, sorry.
Also: what's the rationale of allowing negative values too?
Bye,
bearophile
--
On Jan 23, 12:27 am, bearophileh...@lycos.com wrote:
bearophile:
Are keys restricted to be long and int values only? Or are they
general (referenced) objects + a control of their integral nature?
Here I meant values, sorry.
Also: what's the rationale of allowing negative values too?
The
msrache...@gmail.com wrote:
The term counter was what was originally approved. At first, I didn't
like it but found that it had some advantages. The main advantage is
that there are *bazillions* of programmers (including some very good
ones) who have never heard the term multiset or bag but
bearophileh...@lycos.com wrote:
Also: what's the rationale of allowing negative values too?
I can guess two:
1) Nuisance to check given that Python does not have a count (0,1,2...)
type.
2. Useful. + = items on hand; - = items back-ordered.
Bank account go negative also ;-). So does
On 1/23/2009 2:49 AM, Chris Rebert wrote:
On Thu, Jan 22, 2009 at 5:41 PM, Giovanni Bajo ra...@develer.com wrote:
On Thu, 22 Jan 2009 10:11:37 -0800, Raymond Hettinger wrote:
The collections module in Python 2.7 and Python 3.1 has gotten a new
Counter class that works like bags and multisets
Terry Reedy wrote:
bearophileh...@lycos.com wrote:
Also: what's the rationale of allowing negative values too?
I can guess two:
1) Nuisance to check given that Python does not have a count
(0,1,2...) type.
2. Useful. + = items on hand; - = items back-ordered. Bank account go
negative also
I've adapted it for Python2.5/2.6 so people can start using it right
away:
That should just be Python2.6.
--
http://mail.python.org/mailman/listinfo/python-list
That should just be Python2.6.
Fixed. Now runs of Python 2.5 as well.
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 22 Jan 2009 10:11:37 -0800, Raymond Hettinger wrote:
The collections module in Python 2.7 and Python 3.1 has gotten a new
Counter class that works like bags and multisets in other languages.
I've adapted it for Python2.5/2.6 so people can start using it right
away:
On Thu, Jan 22, 2009 at 5:41 PM, Giovanni Bajo ra...@develer.com wrote:
On Thu, 22 Jan 2009 10:11:37 -0800, Raymond Hettinger wrote:
The collections module in Python 2.7 and Python 3.1 has gotten a new
Counter class that works like bags and multisets in other languages.
I've adapted it for
Giovanni Bajo ra...@develer.com writes:
* I'm not a native speaker, but why use the word Counter?
I agree with this, the new functionality is welcome but I think
the traditional term multiset or bag would have been better.
--
http://mail.python.org/mailman/listinfo/python-list
Hi Raymond,
* I'm not a native speaker, but why use the word Counter? A counter
to my ear sounds like a number that is increased each time an event
occurs; the website counter, eg, comes to mind. I can understanda its
meaning probably stretches to an object that counts, but I really can't
Chris Rebert wrote:
On Thu, Jan 22, 2009 at 5:41 PM, Giovanni Bajo ra...@develer.com wrote:
On Thu, 22 Jan 2009 10:11:37 -0800, Raymond Hettinger wrote:
The collections module in Python 2.7 and Python 3.1 has gotten a new
Counter class that works like bags and multisets in other languages.
On Jan 22, 5:41 pm, Giovanni Bajo ra...@develer.com wrote:
* I find it *very* confusing c.items() vs c.elements(). Items and
elements are synonymous (again, in my understanding of English).
Would have used the term items but that term has a different meaning
in the context of dictionaries where
On Jan 22, 5:54 pm, Paul Rubin http://phr...@nospam.invalid wrote:
Giovanni Bajo ra...@develer.com writes:
* I'm not a native speaker, but why use the word Counter?
I agree with this, the new functionality is welcome but I think
the traditional term multiset or bag would have been better.
18 matches
Mail list logo