From bags to default dicts

M

Mark E. Fenner

Hello all,

I was curious if anyone has transitioned some code from using Raymond
Hettinger's bag class:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/259174

to using 2.5's collections.defaultdict. Any pitfalls to watch out for? It
seems we should be able to do slightly better than creating a bag class
that has a defaultdict as a member. So, inheriting from defaultdict and
defining some of the nice utility methods that Hettinger's class defines
seems like the way to go. Comments?

Regards,
Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top