[Nym3-commit] r212 - trunk/nym3

laurent at conuropsis.org laurent at conuropsis.org
Sun May 1 17:19:17 CEST 2005


Author: laurent
Date: 2005-05-01 17:19:15 +0200 (Sun, 01 May 2005)
New Revision: 212

Modified:
   trunk/nym3/Message.py
Log:
Rewrote isMidList.


Modified: trunk/nym3/Message.py
===================================================================
--- trunk/nym3/Message.py	2005-05-01 14:38:31 UTC (rev 211)
+++ trunk/nym3/Message.py	2005-05-01 15:19:15 UTC (rev 212)
@@ -83,15 +83,11 @@
 		res = res + 1
 	return res
 
-def isMidList(l,n):
-	"""true if l is a list of strings of length n"""
-	def isMid(e):
-		if( len(e) == n and type(e) == types.StringType):
-			return True
-		else:
-			return False
-	lb = map(isMid, l)
-	return (reduce(lambda x, y: x and y, lb))
+def isMidList(l, n):
+    """true if l is a list of strings of length n"""
+    for i in l:
+	if ((len(i) != n) or (type(i) != types.StringType)): return False
+    return True
 
 sigLength = Common.sigLength
 """The length of signatures in bytes"""



More information about the Nym3-commit mailing list