Changes between Version 11 and Version 12 of HelperFunctions
- Timestamp:
- Sep 26, 2006, 5:51:04 PM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
HelperFunctions
v11 v12 217 217 from itertools import groupby 218 218 219 def countdistinct(iterable, groups= [], key=None):219 def countdistinct(iterable, groups=None, key=None): 220 220 """Count things. 221 221 … … 240 240 {'buzz': 2} 241 241 """ 242 if groups is None: groups = [] 242 243 d = dict([(g, 0) for g in groups]) 243 244 for g, l in groupby(iterable, key=key):