-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Open
Description
xref #29129 which implements ndarray.astype(newdtype, casting='same_value')
but only for built-in NumPy numeric types.
In order to make the same_value
casting work for user-defined dtypes, we need to think about
- registering a casting function which currently has no interface to say "use this casting function only for a specific casting kwarg"
- registering coercion rules which also does not allow any conditional rule depending on the cast kwarg.
Also, it seems same_value
casting does not fit neatly into the post-NEP-50 casting rules we currently have, since it explicitly excludes a value-based answer to can_cast
.
@seberg, I tried to summarize the essence of the problem solved by mattip#94. Did I miss or misunderstand something?
Metadata
Metadata
Assignees
Labels
No labels