pass
error = Error # backward compatibility
+try:
+ from org.python.core import PyStringMap
+except ImportError:
+ PyStringMap = None
+
def copy(x):
"""Shallow copy operation on arbitrary Python objects.
def _copy_dict(x):
return x.copy()
d[types.DictionaryType] = _copy_dict
+if PyStringMap is not None:
+ d[PyStringMap] = _copy_dict
def _copy_inst(x):
if hasattr(x, '__copy__'):
y[deepcopy(key, memo)] = deepcopy(x[key], memo)
return y
d[types.DictionaryType] = _deepcopy_dict
+if PyStringMap is not None:
+ d[PyStringMap] = _deepcopy_dict
def _keep_alive(x, memo):
"""Keeps a reference to the object x in the memo.