From d4bd546af5182f106bfc3232750342670247beca Mon Sep 17 00:00:00 2001 From: Dan Nasman Date: Sat, 14 Oct 2023 16:45:04 +0300 Subject: [PATCH 1/2] fix clippy issues --- vm/src/protocol/object.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vm/src/protocol/object.rs b/vm/src/protocol/object.rs index 639e24dda5..ca15d915e2 100644 --- a/vm/src/protocol/object.rs +++ b/vm/src/protocol/object.rs @@ -552,8 +552,14 @@ impl PyObject { // type protocol // PyObject *PyObject_Type(PyObject *o) + pub fn type_call(&self) -> PyObjectRef { + self.class().to_owned().into() + } // int PyObject_TypeCheck(PyObject *o, PyTypeObject *type) + pub fn type_check(&self, typ: PyTypeRef) -> bool { + self.class().fast_isinstance(&typ) + } pub fn length_opt(&self, vm: &VirtualMachine) -> Option> { self.to_sequence(vm) From 36e5eb0965c7ec7d7d9121a48c35a75a71e4d16f Mon Sep 17 00:00:00 2001 From: Dan Nasman Date: Sat, 14 Oct 2023 16:49:48 +0300 Subject: [PATCH 2/2] change naming --- vm/src/protocol/object.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vm/src/protocol/object.rs b/vm/src/protocol/object.rs index ca15d915e2..15a90c24b0 100644 --- a/vm/src/protocol/object.rs +++ b/vm/src/protocol/object.rs @@ -552,7 +552,7 @@ impl PyObject { // type protocol // PyObject *PyObject_Type(PyObject *o) - pub fn type_call(&self) -> PyObjectRef { + pub fn obj_type(&self) -> PyObjectRef { self.class().to_owned().into() }