diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2014-09-04 22:28:52 +0200 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2014-09-04 22:28:52 +0200 |
commit | 749603e2faa6f44c26883cac83c41faad6b81fd4 (patch) | |
tree | 30ced06bd655ebf8fc09ac32a26bf1c4ca4aa1bb /utils.py | |
parent | c584b8dfa318fc409660b974671162a5af1f49ca (diff) | |
download | clufter-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.py | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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) |