Skip to content

Commit f622c74

Browse files
committed
Allow getting id of cell objects
1 parent 0eddd13 commit f622c74

File tree

1 file changed

+6
-0
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/object

1 file changed

+6
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/object/ObjectNodes.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
import com.oracle.graal.python.builtins.objects.PNone;
8383
import com.oracle.graal.python.builtins.objects.PNotImplemented;
8484
import com.oracle.graal.python.builtins.objects.bytes.PBytes;
85+
import com.oracle.graal.python.builtins.objects.cell.PCell;
8586
import com.oracle.graal.python.builtins.objects.cext.PythonAbstractNativeObject;
8687
import com.oracle.graal.python.builtins.objects.cext.PythonNativeVoidPtr;
8788
import com.oracle.graal.python.builtins.objects.cext.capi.CExtNodes;
@@ -369,6 +370,11 @@ Object id(PythonNativeVoidPtr self) {
369370
return self.getNativePointer();
370371
}
371372

373+
@Specialization
374+
Object id(PCell self) {
375+
return PythonContext.get(this).getNextObjectId(self);
376+
}
377+
372378
protected static boolean isDefaultCase(PythonObject object) {
373379
return !(object instanceof PBytes ||
374380
object instanceof PFrozenSet ||

0 commit comments

Comments
 (0)