summaryrefslogtreecommitdiffstats
path: root/utils.py
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2014-09-04 22:28:52 +0200
committerJan Pokorný <jpokorny@redhat.com>2014-09-04 22:28:52 +0200
commit749603e2faa6f44c26883cac83c41faad6b81fd4 (patch)
tree30ced06bd655ebf8fc09ac32a26bf1c4ca4aa1bb /utils.py
parentc584b8dfa318fc409660b974671162a5af1f49ca (diff)
downloadclufter-749603e2faa6f44c26883cac83c41faad6b81fd4.tar.gz
clufter-749603e2faa6f44c26883cac83c41faad6b81fd4.tar.xz
clufter-749603e2faa6f44c26883cac83c41faad6b81fd4.zip
Solve a "read-only dict as API" question once forever
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/utils.py b/utils.py
index 529d269..d43fdc3 100644
--- a/utils.py
+++ b/utils.py
@@ -53,6 +53,10 @@ def isinstanceexcept(subj, obj, exc=()):
return isinstance(subj, obj) and not isinstance(subj, exc)
+def areinstances(obj1, obj2):
+ isinstance(obj1, obj2.__class__) or isinstance(obj2, obj1.__class__)
+
+
def popattr(obj, what, *args):
assert len(args) < 2
ret = getattr(obj, what, *args)