Skip to content

Commit deb991c

Browse files
committed
Implement stub for 'gc.get_referents'.
1 parent 953dc00 commit deb991c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/GcModuleBuiltins.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import com.oracle.graal.python.builtins.PythonBuiltins;
3535
import com.oracle.graal.python.builtins.objects.cext.PythonNativeClass;
3636
import com.oracle.graal.python.builtins.objects.cext.PythonNativeObject;
37+
import com.oracle.graal.python.builtins.objects.list.PList;
3738
import com.oracle.graal.python.builtins.objects.tuple.PTuple;
3839
import com.oracle.graal.python.nodes.function.PythonBuiltinNode;
3940
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
@@ -104,4 +105,15 @@ public boolean isTracked(@SuppressWarnings("unused") Object object) {
104105
return true;
105106
}
106107
}
108+
109+
@Builtin(name = "get_referents", takesVarArgs = true)
110+
@GenerateNodeFactory
111+
abstract static class GcGetReferentsNode extends PythonBuiltinNode {
112+
@Specialization
113+
PList getReferents(@SuppressWarnings("unused") Object objects) {
114+
// TODO: this is just a dummy implementation; for native objects, this should actually
115+
// use 'tp_traverse'
116+
return factory().createList();
117+
}
118+
}
107119
}

0 commit comments

Comments
 (0)