

@classmethod
def _simple_new(cls, values, name=None, dtype=None, **kwargs):
    '\n        we require the we have a dtype compat for the values\n        if we are passed a non-dtype compat, then coerce using the constructor\n\n        Must be careful not to recurse.\n        '
    if (not hasattr(values, 'dtype')):
        if ((values is None) and (dtype is not None)):
            values = np.empty(0, dtype=dtype)
        else:
            values = np.array(values, copy=False)
            if is_object_dtype(values):
                values = cls(values, name=name, dtype=dtype, **kwargs)._values
    result = object.__new__(cls)
    result._data = values
    result.name = name
    for (k, v) in compat.iteritems(kwargs):
        setattr(result, k, v)
    return result._reset_identity()

dataset/ETHPy150Open pydata/pandas/pandas/indexes/base.py Index._simple_new/original