(cls, scalars, *, dtype: Dtype | None = None, copy=False)
| 180 | |
| 181 | @classmethod |
| 182 | def _from_sequence(cls, scalars, *, dtype: Dtype | None = None, copy=False): |
| 183 | if isinstance(scalars, dt.date): |
| 184 | raise TypeError |
| 185 | elif isinstance(scalars, DateArray): |
| 186 | if dtype is not None: |
| 187 | return scalars.astype(dtype, copy=copy) |
| 188 | if copy: |
| 189 | return scalars.copy() |
| 190 | return scalars[:] |
| 191 | elif isinstance(scalars, np.ndarray): |
| 192 | scalars = scalars.astype("U10") # 10 chars for yyyy-mm-dd |
| 193 | return DateArray(scalars) |