Mercurial > code > home > repos > light9
diff light8/util.py @ 4:f974a462133f
added light8 from the posted light8-1.0.tgz
author | drewp |
---|---|
date | Sun, 07 Jul 2002 01:16:10 +0000 |
parents | 45b12307c695 |
children | 62c47c3a90cb |
line wrap: on
line diff
--- a/light8/util.py Thu Jul 04 10:04:18 2002 +0000 +++ b/light8/util.py Sun Jul 07 01:16:10 2002 +0000 @@ -1,3 +1,4 @@ + def maxes(dicts): ''' ({'a' : 5, 'b' : 9}, {'a' : 10, 'b' : 943}) @@ -13,11 +14,3 @@ return dict([(k,v*scl) for k,v in d.items()]) # class Setting that scales, maxes - -def subsetdict(d, dkeys, default=0): - """Subset of dictionary d: only the keys in dkeys. If you plan on omitting - keys, make sure you like the default.""" - newd = {} # dirty variables! - for k in dkeys: - newd[k] = d.get(k, default) - return newd