chaokunyang commented on code in PR #1970:
URL: https://github.com/apache/fury/pull/1970#discussion_r1874510390


##########
python/pyfury/_serialization.pyx:
##########
@@ -2049,7 +2050,13 @@ cdef class MapSerializer(Serializer):
         buffer.write_varint32(len(value))
         cdef ClassInfo key_classinfo
         cdef ClassInfo value_classinfo
-        for k, v in value.items():
+        cdef int64_t key_addr, value_addr
+        cdef Py_ssize_t pos = 0
+        while PyDict_Next(value, &pos, <PyObject **>&key_addr, <PyObject 
**>&value_addr) != 0:
+            k = int2obj(key_addr)
+            Py_INCREF(k)

Review Comment:
   This auto generated operation is not that intuitive to me, maybe we should 
continue to consider refactoring cython code into other bindings like 
nanobind/pybind in #1887 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to