@classmethod<EOL><INDENT>def _simple_new(cls, values, name=None, freq=None, tz=None, dtype=None):<DEDENT>
if isinstance(values, DatetimeArray):<EOL><INDENT>if tz:<EOL><INDENT>tz = validate_tz_from_dtype(dtype, tz)<EOL>dtype = DatetimeTZDtype(tz=tz)<EOL><DEDENT>elif dtype is None:<EOL><INDENT>dtype = _NS_DTYPE<EOL><DEDENT>values = DatetimeArray(values, freq=freq, dtype=dtype)<EOL>tz = values.tz<EOL>freq = values.freq<EOL>values = values._data<EOL><DEDENT>if isinstance(values, DatetimeIndex):<EOL><INDENT>values = values._data<EOL><DEDENT>dtype = tz_to_dtype(tz)<EOL>dtarr = DatetimeArray._simple_new(values, freq=freq, dtype=dtype)<EOL>assert isinstance(dtarr, DatetimeArray)<EOL>result = object.__new__(cls)<EOL>result._data = dtarr<EOL>result.name = name<EOL>result._index_data = dtarr._data<EOL>result._reset_identity()<EOL>return result<EOL>
we require the we have a dtype compat for the values
if we are passed a non-dtype compat, then coerce using the constructor