From bags to default dicts

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark E. Fenner

    #1

    From bags to default dicts

    Hello all,

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



    to using 2.5's collections.def aultdict. 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
Working...