Re: creating and appending to a dictionary of a list of lists

2007-08-15 Thread pyscottishguy
On Aug 15, 8:08 am, Ant <[EMAIL PROTECTED]> wrote: > On Aug 15, 3:30 am, [EMAIL PROTECTED] wrote: > > > Hey, > > > I started with this: > > > factByClass = {} > > ... > > def update(key, *args): > > x = factByClass.setdefault(key, [[], [], [], [] ]) > > for i, v in enumerate(args): > >

Re: creating and appending to a dictionary of a list of lists

2007-08-15 Thread Ant
On Aug 15, 3:30 am, [EMAIL PROTECTED] wrote: > Hey, > > I started with this: > > factByClass = {} > ... > def update(key, *args): > x = factByClass.setdefault(key, [[], [], [], [] ]) > for i, v in enumerate(args): > x[i].append(v) > > Is there a better way? Well, the following is p