File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed
com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 126
126
import com .oracle .graal .python .nodes .attributes .ReadAttributeFromObjectNode ;
127
127
import com .oracle .graal .python .nodes .attributes .WriteAttributeToObjectNode ;
128
128
import com .oracle .graal .python .nodes .call .PythonCallNode ;
129
+ import com .oracle .graal .python .nodes .classes .IsSubtypeNode ;
129
130
import com .oracle .graal .python .nodes .expression .BinaryComparisonNode ;
130
131
import com .oracle .graal .python .nodes .function .BuiltinFunctionRootNode ;
131
132
import com .oracle .graal .python .nodes .function .PythonBuiltinBaseNode ;
@@ -2043,4 +2044,19 @@ long doGeneric(Object n) {
2043
2044
return asPrimitiveNode .executeLong (n , 0 , Long .BYTES );
2044
2045
}
2045
2046
}
2047
+
2048
+ @ Builtin (name = "PyType_IsSubtype" , fixedNumOfPositionalArgs = 2 )
2049
+ @ GenerateNodeFactory
2050
+ abstract static class PyType_IsSubtype extends PythonBinaryBuiltinNode {
2051
+ @ Child private IsSubtypeNode isSubtypeNode = IsSubtypeNode .create ();
2052
+
2053
+ @ Specialization
2054
+ int doI (PythonClass a , PythonClass b ) {
2055
+ if (isSubtypeNode .execute (a , b )) {
2056
+ return 1 ;
2057
+ }
2058
+ return 0 ;
2059
+ }
2060
+ }
2061
+
2046
2062
}
Original file line number Diff line number Diff line change @@ -808,11 +808,6 @@ def PyObject_Repr(o):
808
808
return repr (o )
809
809
810
810
811
- @may_raise (- 1 )
812
- def PyType_IsSubtype (a , b ):
813
- return 1 if issubclass (a , b ) else 0
814
-
815
-
816
811
def PyTuple_New (size ):
817
812
return (None ,) * size
818
813
You can’t perform that action at this time.
0 commit comments