From e808b34b7040d4d81d423c287c51413253aad90e Mon Sep 17 00:00:00 2001 From: Jan Pokorný Date: Thu, 21 Jan 2016 15:07:20 +0100 Subject: utils: new helper areinstancesupto (akin to areinstances) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan Pokorný --- utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils.py b/utils.py index 7bc36f9..4bb694a 100644 --- a/utils.py +++ b/utils.py @@ -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): -- cgit