From e757277abd8cd4dc46e9b9775ec4c990c36c5cf1 Mon Sep 17 00:00:00 2001 From: gregw <> Date: Thu, 4 Jan 2001 22:54:21 +0000 Subject: [PATCH] *** empty log message *** --- direct/src/showbase/PythonUtil.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/direct/src/showbase/PythonUtil.py b/direct/src/showbase/PythonUtil.py index e4cf96b975..1be6711b4d 100644 --- a/direct/src/showbase/PythonUtil.py +++ b/direct/src/showbase/PythonUtil.py @@ -101,3 +101,15 @@ def doc(obj): (isinstance(obj, types.FunctionType)): print obj.__doc__ +def intersection(a, b): + """ + intersection(list, list): + """ + c = a + b + d = [] + for i in c: + if (i in a) and (i in b): + # make it unique, like a set + if (i not in d): + d.append(i) + return d