annotate light8/util.py @ 35:3cbe7110d8f7
cleanup imports, fix backwards colors in changing level direction
cleanup imports, fix backwards colors in changing level direction
indicators
author |
dmcc |
date |
Sun, 07 Jul 2002 12:11:42 +0000 |
parents |
f974a462133f |
children |
62c47c3a90cb |
rev |
line source |
4
|
1
|
0
|
2 def maxes(dicts):
|
|
3 '''
|
|
4 ({'a' : 5, 'b' : 9}, {'a' : 10, 'b' : 943})
|
|
5 '''
|
|
6 newdict = {}
|
|
7 for d in dicts:
|
|
8 for k,v in d.items():
|
|
9 newdict[k] = max(v, newdict.get(k, 0))
|
|
10 return newdict
|
|
11
|
|
12 def scaledict(d,scl):
|
|
13 # scales all values in dict and returns a new dict
|
|
14 return dict([(k,v*scl) for k,v in d.items()])
|
|
15
|
|
16 # class Setting that scales, maxes
|