diff options
-rw-r--r-- | portage/util/inheritance.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/portage/util/inheritance.py b/portage/util/inheritance.py new file mode 100644 index 0000000..0105e9b --- /dev/null +++ b/portage/util/inheritance.py @@ -0,0 +1,11 @@ +# Copyright: 2005 Gentoo Foundation +# Author(s): Brian Harring (ferringb@gentoo.org) +# License: GPL2 +# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/util/inheritance.py,v 1.1 2005/08/05 04:42:41 ferringb Exp $ + +def check_for_base(obj, allowed): + """Look through __class__ to see if any of the allowed classes are found, returning the first allowed found""" + for x in allowed: + if issubclass(obj.__class__, x): + return x + return None |