numpy.h
54.5 KB
-
Fix ambiguous initialize_list arguments · 51d18aa2
This removes the convert-from-arithemtic-scalar constructor of any_container as it can result in ambiguous calls, as in: py::array_t<float>({ 1, 2 }) which could be intepreted as either of: py::array_t<float>(py::array_t<float>(1, 2)) py::array_t<float>(py::detail::any_container({ 1, 2 })) Removing the convert-from-arithmetic constructor reduces the number of implicit conversions, avoiding the ambiguity for array and array_t. This also re-adds the array/array_t constructors taking a scalar argument for backwards compatibility.Jason Rhinelander committed