From 8d77df7c0e116e4cd1f6aa38f00b856571327d49 Mon Sep 17 00:00:00 2001 From: Jan Pokorný Date: Tue, 17 Jun 2014 19:55:33 +0200 Subject: command_context: restore common dict semantics + allow "bypass" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan Pokorný --- utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'utils.py') 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) -- cgit