You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
docs: diff does not specify type promotion behavior #852
diff() potentially takes multiple arrays as input (x, prepend, and append). But it doesn't specify if they should type promote together, or if the standard is only defined when prepend and append have the same data type as x
In the current specification guidance, we state that prepend and append should have the same data type as x. Given that prepend and append are kwarg-only and we have yet, TMK, to specify an API in which array kwargs may affect the output dtype, personally, I do not think we should allow type promotion such that the output array may be of a different dtype than x.
However, I think we can clarify, in a note, that if an array library chooses to support prepend and append which are not of the same dtype as x, then behavior is implementation-defined.
Activity
[-]diff() does not specify type promotion behavior[/-][+]docs: `diff` does not specify type promotion behavior[/+]kgryte commentedon Jan 9, 2025
In the current specification guidance, we state that
prependandappendshould have the same data type asx. Given thatprependandappendare kwarg-only and we have yet, TMK, to specify an API in which array kwargs may affect the output dtype, personally, I do not think we should allow type promotion such that the output array may be of a different dtype thanx.However, I think we can clarify, in a note, that if an array library chooses to support
prependandappendwhich are not of the same dtype asx, then behavior is implementation-defined.docs: clarify type promotion behavior in `diff`
docs: clarify type promotion behavior in `diff`