diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2016-01-21 15:07:20 +0100 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2016-02-01 23:53:26 +0100 |
commit | e808b34b7040d4d81d423c287c51413253aad90e (patch) | |
tree | b17d05c6feeb79c513a0ce7e209fe3b9f6abdf56 /utils.py | |
parent | 183bc49963df6b228f022a46084698214b38771a (diff) | |
download | clufter-e808b34b7040d4d81d423c287c51413253aad90e.tar.gz clufter-e808b34b7040d4d81d423c287c51413253aad90e.tar.xz clufter-e808b34b7040d4d81d423c287c51413253aad90e.zip |
utils: new helper areinstancesupto (akin to areinstances)
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'utils.py')
-rw-r--r-- | utils.py | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -117,6 +117,9 @@ def areinstances(obj1, obj2): return isinstance(obj1, obj2.__class__) or isinstance(obj2, obj1.__class__) +def areinstancesupto(obj1, obj2, *exc): + return isinstanceupto(obj1, obj2.__class__, *exc) \ + or isinstanceupto(obj2, obj1.__class__, *exc) def popattr(obj, what, *args): |