Skip to content

Commit 962de28

Browse files
committed
[GR-16816] Implement stub for 'gc.get_referents'.
PullRequest: graalpython/608
2 parents 822dea0 + deb991c commit 962de28

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
@@ -35,6 +35,7 @@
3535
import com.oracle.graal.python.builtins.objects.PNone;
3636
import com.oracle.graal.python.builtins.objects.cext.PythonNativeClass;
3737
import com.oracle.graal.python.builtins.objects.cext.PythonNativeObject;
38+
import com.oracle.graal.python.builtins.objects.list.PList;
3839
import com.oracle.graal.python.builtins.objects.tuple.PTuple;
3940
import com.oracle.graal.python.nodes.function.PythonBuiltinNode;
4041
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
@@ -131,4 +132,15 @@ public boolean isTracked(@SuppressWarnings("unused") Object object) {
131132
return true;
132133
}
133134
}
135+
136+
@Builtin(name = "get_referents", takesVarArgs = true)
137+
@GenerateNodeFactory
138+
abstract static class GcGetReferentsNode extends PythonBuiltinNode {
139+
@Specialization
140+
PList getReferents(@SuppressWarnings("unused") Object objects) {
141+
// TODO: this is just a dummy implementation; for native objects, this should actually
142+
// use 'tp_traverse'
143+
return factory().createList();
144+
}
145+
}
134146
}

0 commit comments

Comments
 (0)