commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

r5802 - trunk/gnue-common/src/datasources


From: johannes
Subject: r5802 - trunk/gnue-common/src/datasources
Date: Tue, 11 May 2004 03:01:45 -0500 (CDT)

Author: johannes
Date: 2004-05-11 03:01:44 -0500 (Tue, 11 May 2004)
New Revision: 5802

Modified:
   trunk/gnue-common/src/datasources/GConditions.py
Log:
unify (): pass through of None values



Modified: trunk/gnue-common/src/datasources/GConditions.py
===================================================================
--- trunk/gnue-common/src/datasources/GConditions.py    2004-05-11 07:20:32 UTC 
(rev 5801)
+++ trunk/gnue-common/src/datasources/GConditions.py    2004-05-11 08:01:44 UTC 
(rev 5802)
@@ -1039,7 +1039,12 @@
   v1 = values [0]
   v2 = values [1]
 
-  if type (v1) == type (v2):
+  if v1 is None or v2 is None:
+    result.append (None)
+    values.remove (None)
+    __unify (values, result)
+
+  elif type (v1) == type (v2):
     result.append (v1)
     values.remove (v1)
     __unify (values, result)
@@ -1344,6 +1349,9 @@
   _check_unify ([1])
   _check_unify ([None])
   _check_unify (['5.43', 12, 18L])
+  _check_unify ([None, 'foo'])
+  _check_unify (['foo', None])
+  _check_unify ([5, None, 2, None, '10'])
 
   print "unification sequence complete"
   raw_input ()





reply via email to

[Prev in Thread] Current Thread [Next in Thread]