James Mills wrote:
On Wed, Dec 31, 2008 at 10:22 AM, John Machin <sjmac...@lexicon.net> wrote:
(snip)

The "crawl through the shrubbery looking for evidence" approach
stumbles on the actual code:

Yes I found his implementation soon after :)
Not bad actually... I wonder why bag() isn't
shipped with the std lib - perhaps in teh set
module ?

Occasionally someone posts here wanting to count items and solutions involving dict or defaultdict are suggested, and I think that a 'bag' class would be useful. The 'set' class was introduced first in a module, but it soon became a builtin. My posting was intended a possible reference implementation.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to