[Numpy-discussion] two questions about `choose`

2021-04-17 Thread Alan G. Isaac
1. Is there a technical reason for `choose` not accept a `dtype` argument? 2. Separately, mypy is unhappy with my 2nd argument to `choose`: Argument 2 to "choose" has incompatible type "Tuple[int, Sequence[float]]"; expected "Union[Union[int, float, complex, str, bytes, generic], Sequence[Union[i

Re: [Numpy-discussion] two questions about `choose`

2021-04-17 Thread Kevin Sheppard
1. I suppose it only uses the (Native int or int64) dtype since each one would need a code path to run quickly. 2. I would describe this a a bug. I think sequences are converted to arrays and in this case the conversion is not returning a 2 element object array but expanding and then concatenation