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
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