> manifest.py:
>    line 97:  is there any reason to not make this private? i.e. 
> __actions_bytype

I kept it public since actions is still public.  That gets used in many places
outside of manifest.  I don't really care either way, but thought we
might want to be consistent.

> General Questions
> =================
> I've been wondering where the "if blah in foo" construct is faster or 
> slower than something like:
> 
>    lst = None
>    try:
>         lst = self.actions_bytype[type]
>    except KeyError:
>            lst = self.actions_bytype[type] = []
> 
> or...
> 
>    try:
>            self.actions_bytype[action.name].append(action)
>    except KeyError:
>            self.actions_bytype[action.name] = [action]
> 
> In the case that you had a lot of items, I could see the try/except 
> being faster since you wouldn't incur the lookup expense.  In initial 
> attempts, I could see the exception overhead slowing things down.

There aren't going to be many keys in this dictionary.  In the worst
case today, we'll have 12 entries, each with a list.

-j

_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to