[open-ils-commits] r7572 - trunk/Open-ILS/src/python/oils/utils
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Jul 22 20:02:53 EDT 2007
Author: erickson
Date: 2007-07-22 20:02:16 -0400 (Sun, 22 Jul 2007)
New Revision: 7572
Modified:
trunk/Open-ILS/src/python/oils/utils/utils.py
Log:
added a list unique-ifier
Modified: trunk/Open-ILS/src/python/oils/utils/utils.py
===================================================================
--- trunk/Open-ILS/src/python/oils/utils/utils.py 2007-07-21 19:34:02 UTC (rev 7571)
+++ trunk/Open-ILS/src/python/oils/utils/utils.py 2007-07-23 00:02:16 UTC (rev 7572)
@@ -46,3 +46,11 @@
m = md5.new()
m.update(str)
return m.hexdigest()
+
+def unique(arr):
+ ''' Unique-ify a list. only works if list items are hashable '''
+ o = {}
+ for x in arr:
+ o[x] = 1
+ return o.keys()
+
More information about the open-ils-commits
mailing list