Skip to content

Commit 3f6a317

Browse files
committed
add simplest possible PyDict_Values
1 parent 58ab6ec commit 3f6a317

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

graalpython/com.oracle.graal.python.cext/src/dictobject.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,8 @@ UPCALL_ID(PyDict_Merge);
207207
int PyDict_Merge(PyObject *a, PyObject *b, int override) {
208208
return UPCALL_CEXT_I(_jls_PyDict_Merge, native_to_java(a), native_to_java(b), override);
209209
}
210+
211+
UPCALL_ID(PyDict_Values);
212+
PyObject * PyDict_Values(PyObject *dict) {
213+
return UPCALL_CEXT_O(_jls_PyDict_Values, native_to_java(dict));
214+
}

graalpython/lib-graalpython/python_cext.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ def PyDict_Merge(a, b, override):
218218
a[k] = b[k]
219219
return 0
220220

221+
@may_raise
222+
def PyDict_Values(d):
223+
return list(d.values())
224+
221225
##################### SET, FROZENSET
222226

223227

0 commit comments

Comments
 (0)