atm we're checking dict-like by doing isinstance(x, dict), I think we should be using collections.MutableMapping, slightly more general.