/** * Merge another PyObject that supports keys() with this * dict. * * @param other a PyObject with a keys() method */ private void merge(PyObject other) { if (other instanceof PyStringMap) { table.putAll(((PyStringMap)other).table); } else if (other instanceof PyDictionary) { mergeFromKeys(other, ((PyDictionary)other).keys()); } else { mergeFromKeys(other, other.invoke("keys")); } }