This is another chapter in the saga to split up _lib.pyx to make it easier to find the piece of code one is looking for. Another advantage of this is that VSCode's Cython plugin does a much better job when cimports are explicit: for something like from nanoarrow_c cimport *, this means that every use of a nanoarrow symbol (including NANOARROW_TYPE_XXX) would get a yellow squiggly underline (which normally highlight things that should be fixed). The setup here enables both Python and Cython modules to use _types.UINT8. In Cython this compiles into a C symbol reference (i.e., not an attribute lookup, which might be slow).
This is another chapter in the saga to split up _lib.pyx to make it easier to find the piece of code one is looking for. Another advantage of this is that VSCode's Cython plugin does a much better job when
cimport
s are explicit: for something likefrom nanoarrow_c cimport *
, this means that every use of a nanoarrow symbol (includingNANOARROW_TYPE_XXX
) would get a yellow squiggly underline (which normally highlight things that should be fixed). The setup here enables both Python and Cython modules to use_types.UINT8
. In Cython this compiles into a C symbol reference (i.e., not an attribute lookup, which might be slow).