We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4e6172b commit 0e72ba8Copy full SHA for 0e72ba8
vm/src/protocol/object.rs
@@ -559,8 +559,14 @@ impl PyObject {
559
560
// type protocol
561
// PyObject *PyObject_Type(PyObject *o)
562
+ pub fn obj_type(&self) -> PyObjectRef {
563
+ self.class().to_owned().into()
564
+ }
565
566
// int PyObject_TypeCheck(PyObject *o, PyTypeObject *type)
567
+ pub fn type_check(&self, typ: PyTypeRef) -> bool {
568
+ self.class().fast_isinstance(&typ)
569
570
571
pub fn length_opt(&self, vm: &VirtualMachine) -> Option<PyResult<usize>> {
572
self.to_sequence(vm)
0 commit comments