@@ -10,6 +10,7 @@ function (::pyconvert_rule_numpysimplevalue{R,SAFE})(::Type{T}, x::Py) where {R,
1010end
1111
1212const NUMPY_SIMPLE_TYPES = [
13+ (" bool_" , Bool),
1314 (" int8" , Int8),
1415 (" int16" , Int16),
1516 (" int32" , Int32),
@@ -27,17 +28,18 @@ const NUMPY_SIMPLE_TYPES = [
2728]
2829
2930function init_numpy ()
30- for (t,T) in NUMPY_SIMPLE_TYPES
31- isint = occursin (" int" , t)
32- isuint = occursin (" uint" , t)
31+ for (t, T) in NUMPY_SIMPLE_TYPES
32+ isbool = occursin (" bool" , t)
33+ isint = occursin (" int" , t) || isbool
34+ isuint = occursin (" uint" , t) || isbool
3335 isfloat = occursin (" float" , t)
3436 iscomplex = occursin (" complex" , t)
3537 isreal = isint || isfloat
3638 isnumber = isreal || iscomplex
3739
3840 name = " numpy:$t "
39- rule = pyconvert_rule_numpysimplevalue {T, false} ()
40- saferule = pyconvert_rule_numpysimplevalue {T, true} ()
41+ rule = pyconvert_rule_numpysimplevalue {T,false} ()
42+ saferule = pyconvert_rule_numpysimplevalue {T,true} ()
4143
4244 pyconvert_add_rule (name, T, saferule, PYCONVERT_PRIORITY_ARRAY)
4345 isuint && pyconvert_add_rule (name, UInt, sizeof (T) ≤ sizeof (UInt) ? saferule : rule)
0 commit comments