junrushao commented on code in PR #36:
URL: https://github.com/apache/tvm-ffi/pull/36#discussion_r2392774959


##########
python/tvm_ffi/cython/type_info.pxi:
##########
@@ -58,6 +59,80 @@ cdef class FieldSetter:
             raise_existing_error()
         raise move_from_last_error().py_error()
 
+_TYPE_SCHEMA_ORIGIN_CONVERTER = {
+    # A few Python-native types
+    "Variant": "Union",
+    "Optional": "Optional",
+    "Tuple": "tuple",
+    "ffi.Function": "Callable",
+    "ffi.Array": "list",
+    "ffi.Map": "dict",
+    "ffi.OpaquePyObject": "Any",
+    # ctype types
+    "void*": "ctypes.c_void_p",
+    # bytes
+    "TVMFFIByteArray*": "bytes",
+    "ffi.SmallBytes": "bytes",
+    "ffi.Bytes": "bytes",
+    # strings
+    "const char*": "str",
+    "ffi.SmallStr": "str",
+    "ffi.String": "str",

Review Comment:
   good catch!



-- 
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