forked from numpy/numpy
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
The current dtype discovery approach is based on first discovering the DType (class) and then discovering the dtype instance in a second pass (if necessary).
This is slightly annoying, the main motivation for it are String DTypes. Removing the first pass, may mean that common_dtype slot is not needed anymore, but instead should be a common_descriptor slot. However:
common_dtypemay be useful for UFunc dispatching/type resolution (it is currently effectively used). If UFunc dispatching ends up needingcommon_dtypehaving both may be inflation of API functions?- Strings cannot be handled, they require two passes currently. The solution is to keep the current (ugly) logic as legacy. New String dtypes would/can be expected to use
dtype=Stringif they require special logic. If they require special logic, they should likely refuse tocommon_descrfor that. E.g.common_descriptor(datetime[ns], str)should not work ifarray(["2019"], dtype=datetime64)guesses theyearunit.
The main advantage is slightly reducing complexity.
Reactions are currently unavailable