why not isinstance(object, dict) ?