Skip to content

Commit 8b4132b

Browse files
committed
Add resolution for 'tp_as_number' native member.
1 parent ac9fc1b commit 8b4132b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cpyobject/NativeMemberNames.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public abstract class NativeMemberNames {
4747
public static final String TP_FLAGS = "tp_flags";
4848
public static final String TP_NAME = "tp_name";
4949
public static final String TP_BASE = "tp_base";
50+
public static final String TP_AS_NUMBER = "tp_as_number";
5051
public static final String _BASE = "_base";
5152
public static final String OB_ITEM = "ob_item";
5253
public static final String MA_USED = "ma_used";
@@ -69,6 +70,7 @@ public static boolean isValid(String key) {
6970
case TP_FLAGS:
7071
case TP_NAME:
7172
case TP_BASE:
73+
case TP_AS_NUMBER:
7274
case _BASE:
7375
case OB_ITEM:
7476
case MA_USED:

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cpyobject/PythonObjectNativeWrapperMR.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@ Object doTpBase(PythonClass object, @SuppressWarnings("unused") String key) {
185185
return getToSulongNode().execute(object);
186186
}
187187

188+
@Specialization(guards = "eq(TP_AS_NUMBER, key)")
189+
Object doTpAsNumber(PythonClass object, @SuppressWarnings("unused") String key) {
190+
// TODO
191+
return getToSulongNode().execute(object);
192+
}
193+
188194
@Specialization(guards = "eq(OB_ITEM, key)")
189195
Object doObItem(PSequence object, @SuppressWarnings("unused") String key) {
190196
return new PySequenceArrayWrapper(object);

0 commit comments

Comments
 (0)