API: allow mixed-datetimes-and-ints in to_datetime, DatetimeIndex
- [x] closes #49037 (Replace xxxx with the GitHub issue number)
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

cc @jreback this goes a long way towards getting Series/Index constructors to match, but i dont see the reason for the current behavior, do you remember?
I commented on the issue (https://github.com/pandas-dev/pandas/issues/49037), I think I am also +1 on allowing the mixture (although I don't like that specific behaviour, it seems the most consistent if we want to have generally applicable rules)

@jbrockmendel one thing I am wondering: the `allow_mixed` keyword, that's not useful to keep for potential stricter behaviour? (although I assume it's not actually useful for "only datetime objects", since `allow_mixed=False` can also mean that you have only ints) > one thing I am wondering: the allow_mixed keyword, that's not useful to keep for potential stricter behaviour? (although I assume it's not actually useful for "only datetime objects", since allow_mixed=False can also mean that you have only ints)

Assuming you mean in array_to_datetime.  I don't think its particularly useful, but its also not harmful (except for not being tested).  For only-datetime-objects (i.e. the strict from_scalars) i think it may be cleaner to implement a new dedicated function than further overloading array_to_datetime.   failures unrelated Thanks @jbrockmendel 