From a454feae22b70dbad09bee6ae8b273264466acef Mon Sep 17 00:00:00 2001 From: Joe Shochet Date: Tue, 20 Aug 2002 20:56:36 +0000 Subject: [PATCH] same elements --- direct/src/showbase/PythonUtil.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/direct/src/showbase/PythonUtil.py b/direct/src/showbase/PythonUtil.py index 6d7ed1632f..2fde49ea79 100644 --- a/direct/src/showbase/PythonUtil.py +++ b/direct/src/showbase/PythonUtil.py @@ -333,6 +333,17 @@ def union(a, b): c.append(i) 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): """ Reduces an angle (in degrees) to a value between -180. and 180.