summaryrefslogtreecommitdiffstats
path: root/utils.py
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2014-06-17 19:55:33 +0200
committerJan Pokorný <jpokorny@redhat.com>2014-06-17 20:09:53 +0200
commit8d77df7c0e116e4cd1f6aa38f00b856571327d49 (patch)
treec1e7422b5688a7657d857b3457ee64925aac6a27 /utils.py
parentd3cf5ae82f04f221792c25f36a1a204c08965b08 (diff)
downloadclufter-8d77df7c0e116e4cd1f6aa38f00b856571327d49.tar.gz
clufter-8d77df7c0e116e4cd1f6aa38f00b856571327d49.tar.xz
clufter-8d77df7c0e116e4cd1f6aa38f00b856571327d49.zip
command_context: restore common dict semantics + allow "bypass"
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/utils.py b/utils.py
index 00cf5cc..08dbd21 100644
--- a/utils.py
+++ b/utils.py
@@ -46,9 +46,13 @@ filterdict_invpop = \
#
-# function introspection related
+# introspection related
#
+def isinstanceexcept(subj, obj, exc=()):
+ return isinstance(subj, obj) and not isinstance(subj, exc)
+
+
def func_defaults_varnames(func, skip=0):
"""Using introspection, get arg defaults (dict) + all arg names (tuple)