diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2019-11-18 16:13:06 -0800 |
---|---|---|
committer | Sebastian Berg <sebastian@sipsolutions.net> | 2019-11-21 17:06:02 -0800 |
commit | c5da77d47309b6bf11f13f3b2e760f9b21423427 (patch) | |
tree | 621cf8e0f25bb362788683dbbba2b89fb3366611 /numpy/polynomial/polyutils.py | |
parent | 9aeb7513019954718a3225fbab24bdbb98ca4fd5 (diff) | |
download | numpy-c5da77d47309b6bf11f13f3b2e760f9b21423427.tar.gz |
API: Use `ResultType` in `PyArray_ConvertToCommonType`
This slightly modifies the behaviour of `np.choose` (practically a
bug fix) and the public function itself. The function is not used within
e.g. SciPy, so the small performance hit of this implementation
is probably insignificant.
The change should help clean up dtypes a bit, since the whole "scalar
cast" logic is brittle and should be deprecated/removed, and this is
probably one of the few places actually using it.
The choose change means that:
```
np.choose([0], (1000, np.array([1], dtype=np.uint8)))
```
will actually return a value of 1000 (the dtype not being uint8).
Diffstat (limited to 'numpy/polynomial/polyutils.py')
0 files changed, 0 insertions, 0 deletions