[Python-ideas] question - 'bag' type

C. Titus Brown ctb at msu.edu
Thu Apr 15 07:30:38 CEST 2010


On Wed, Apr 14, 2010 at 10:22:13PM -0700, Bruce Leban wrote:
> The example you give is a dict aside from syntax. What makes it bag-like? Do
> you expect that I can write
> 
> b = bag(foo=bar, foo=car)
> 
> But I'd hardly expect b.foo == bar or b.foo == car as you suggest.

I guess I don't understand what a bag is -- I'd just heard this structure
referred to as such.

"dict aside from syntax" is the point, yes!

thanks,
--titus



More information about the Python-ideas mailing list