Open
Description
There has been discussion in eg #39133 about having EA-backed Indexes held in base-class Index objects, similar discussion regarding the new NumericIndex.
I do not like the idea of having some non-object dtypes return the base class Index, but would be on board for making all dtypes use the base class. i.e. only have Index and deprecate/remove all the subclasses. I'm envisioning roughly
- Implement relevant methods on the underlying EAs, eg DatetimeIndex.get_loc logic might live in DatetimeArray.get_loc.
- ??? for RangeIndex and MultiIndex, maybe make corresponding EAs?
- Methods currently available on subclasses but not Index would be accessed via accessor, e.g.
dti.is_year_start
becomesidx.foo.is_year_start
Related but independent, we could do the same with ExtensionArray subclasses. Instead of having authors implement methods on their EA subclass, they implement it on the ExtensionDtype subclass, which the EA object then dispatches to.