diff options
author | Brian Harring <ferringb@gentoo.org> | 2005-08-05 04:42:41 +0000 |
---|---|---|
committer | Brian Harring <ferringb@gentoo.org> | 2005-08-05 04:42:41 +0000 |
commit | fe7e13a1233801c79bc9287fb6568fb3333649e9 (patch) | |
tree | d7d207700c7cf3dbc49b53c13cbcdaefbca2800f | |
parent | use set, not dict for valid. (diff) | |
download | portage-cvs-fe7e13a1233801c79bc9287fb6568fb3333649e9.tar.gz portage-cvs-fe7e13a1233801c79bc9287fb6568fb3333649e9.tar.bz2 portage-cvs-fe7e13a1233801c79bc9287fb6568fb3333649e9.zip |
bam, herpes
-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 |