Pyarray and pytensor rely on pybind11 make_caster<T>::name() to determine the string representation of its value_type (which is then used for the auto-generated docstring). However, make_caster assigns the name "int" to every integral type and "float" to every floating type (except for "char"->"str" and "bool"->"bool").
While this makes perfect sens for vanilla Python, this becomes confusing with Numpy where the precise numeric type is important. For example, defining the two overloaded test functions in the module m:
where the two overloads seem to have an identical signature.
Would it be possible to bypass pybind11 make_caster for types that corresponds to numpy dtypes such that we would get a correct docstring ? (something like: )
Pyarray and pytensor rely on pybind11
make_caster<T>::name()
to determine the string representation of itsvalue_type
(which is then used for the auto-generated docstring). However,make_caster
assigns the name "int" to every integral type and "float" to every floating type (except for "char"->"str" and "bool"->"bool").While this makes perfect sens for vanilla Python, this becomes confusing with Numpy where the precise numeric type is important. For example, defining the two overloaded
test
functions in the modulem
:leads to the following docstring:
where the two overloads seem to have an identical signature.
Would it be possible to bypass pybind11
make_caster
for types that corresponds to numpy dtypes such that we would get a correct docstring ? (something like: )