Replace PyInquiryFunc to PyUnaryFunc<bool>

Signed-off-by: snowapril <sinjihng@gmail.com>
This commit is contained in:
snowapril
2023-04-02 16:11:44 +09:00
parent 9c38e904dd
commit c69ff172e5

View File

@@ -11,7 +11,6 @@ use crate::{
VirtualMachine,
};
pub type PyNumberInquiryFunc = fn(PyNumber, &VirtualMachine) -> PyResult<bool>;
pub type PyNumberUnaryFunc<R = PyObjectRef> = fn(PyNumber, &VirtualMachine) -> PyResult<R>;
pub type PyNumberBinaryFunc = fn(&PyObject, &PyObject, &VirtualMachine) -> PyResult;
pub type PyNumberTernaryFunc = fn(&PyObject, &PyObject, &PyObject, &VirtualMachine) -> PyResult;
@@ -127,7 +126,7 @@ pub struct PyNumberMethods {
pub negative: Option<PyNumberUnaryFunc>,
pub positive: Option<PyNumberUnaryFunc>,
pub absolute: Option<PyNumberUnaryFunc>,
pub boolean: Option<PyNumberInquiryFunc>,
pub boolean: Option<PyNumberUnaryFunc<bool>>,
pub invert: Option<PyNumberUnaryFunc>,
pub lshift: Option<PyNumberBinaryFunc>,
pub rshift: Option<PyNumberBinaryFunc>,
@@ -251,7 +250,7 @@ pub struct PyNumberSlots {
pub negative: AtomicCell<Option<PyNumberUnaryFunc>>,
pub positive: AtomicCell<Option<PyNumberUnaryFunc>>,
pub absolute: AtomicCell<Option<PyNumberUnaryFunc>>,
pub boolean: AtomicCell<Option<PyNumberInquiryFunc>>,
pub boolean: AtomicCell<Option<PyNumberUnaryFunc<bool>>>,
pub invert: AtomicCell<Option<PyNumberUnaryFunc>>,
pub lshift: AtomicCell<Option<PyNumberBinaryFunc>>,
pub rshift: AtomicCell<Option<PyNumberBinaryFunc>>,