Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0e72ba8

Browse files
authored
implement PyObject_Type and PyObject_TypeCheck (RustPython#5091)
1 parent4e6172b commit0e72ba8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎vm/src/protocol/object.rs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,8 +559,14 @@ impl PyObject {
559559

560560
// type protocol
561561
// PyObject *PyObject_Type(PyObject *o)
562+
pubfnobj_type(&self) ->PyObjectRef{
563+
self.class().to_owned().into()
564+
}
562565

563566
// int PyObject_TypeCheck(PyObject *o, PyTypeObject *type)
567+
pubfntype_check(&self,typ:PyTypeRef) ->bool{
568+
self.class().fast_isinstance(&typ)
569+
}
564570

565571
pubfnlength_opt(&self,vm:&VirtualMachine) ->Option<PyResult<usize>>{
566572
self.to_sequence(vm)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp