get method
MRAB
google at mrabarnett.plus.com
Tue Dec 30 19:54:11 EST 2008
James Mills wrote:
> On Wed, Dec 31, 2008 at 10:22 AM, John Machin <sjmachin at 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.
More information about the Python-list
mailing list