diff --git a/td-rs-base/src/py.rs b/td-rs-base/src/py.rs index 49d1e7a..0fbcd2d 100644 --- a/td-rs-base/src/py.rs +++ b/td-rs-base/src/py.rs @@ -213,7 +213,7 @@ impl ToPyObj for f32 { impl CheckPyObj for f32 { unsafe fn check_py_obj(obj: *mut pyo3_ffi::PyObject) -> bool { - pyo3_ffi::PyFloat_Check(obj) != 0 + pyo3_ffi::PyFloat_Check(obj) != 0 || pyo3_ffi::PyLong_Check(obj) != 0 } } @@ -231,7 +231,7 @@ impl ToPyObj for f64 { impl CheckPyObj for f64 { unsafe fn check_py_obj(obj: *mut pyo3_ffi::PyObject) -> bool { - pyo3_ffi::PyFloat_Check(obj) != 0 + pyo3_ffi::PyFloat_Check(obj) != 0 || pyo3_ffi::PyLong_Check(obj) != 0 } } diff --git a/td-rs-derive-py/src/lib.rs b/td-rs-derive-py/src/lib.rs index b524ea6..19d7709 100644 --- a/td-rs-derive-py/src/lib.rs +++ b/td-rs-derive-py/src/lib.rs @@ -154,6 +154,7 @@ fn impl_py_op(input: &DeriveInput) -> TokenStream { .as_ptr() .cast::(), ); + return -1; } let value = FromPyObj::from_py_obj(value);