On Thu, Sep 25, 2008 at 7:35 PM, Dinesh B Vadhia <[EMAIL PROTECTED]> wrote: > I'm using defaultdict(set) to store a dictionary d = {value : set_items} > where value = integer and set_items = set() of characters and it works > perfectly. > > I would like to also store the length of the set ie. l = len(set_items) with > the dictionary but don't how to do it using a defaultdict(). Any ideas?
Why not just take the length when you need it? There is no need to store it separately. e.g. len(d[3]) Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor