Browse Source

same elements

Joe Shochet 23 years ago
parent
commit
a454feae22
1 changed files with 11 additions and 0 deletions
  1. 11 0
      direct/src/showbase/PythonUtil.py

+ 11 - 0
direct/src/showbase/PythonUtil.py

@@ -333,6 +333,17 @@ def union(a, b):
             c.append(i)
             c.append(i)
     return c
     return c
 
 
+def sameElements(a, b):
+    if len(a) != len(b):
+        return 0
+    for elem in a:
+        if elem not in b:
+            return 0
+    for elem in b:
+        if elem not in a:
+            return 0
+    return 1
+
 def reduceAngle(deg):
 def reduceAngle(deg):
     """
     """
     Reduces an angle (in degrees) to a value between -180. and 180.
     Reduces an angle (in degrees) to a value between -180. and 180.