import copy


def _copy(obj):
  """Create a shallow copy of an object. Provides shortcuts for
  certain object types with known copy features, using copy.copy for
  everything else.

  """
  typ = type(obj)
  if typ is list:
    return list(obj)
  elif typ is dict:
    return dict(obj)
  else:
    return copy.copy(obj)