rok commented on PR #51680:
URL: https://github.com/apache/arrow/pull/51680#issuecomment-5937788121

   > Specifically for the example of dynamically create compute kernels: those 
are actually pure-python functions (generated in `compute.py`, not in 
`_compute.pyx`), and so I _assume_ it should be possible to update that 
generation code to directly include type annotations as well (e.g., we now also 
generate a `Signature` to add to the generated function.
   
   I suppose we could generate stubs for compute kernels with stubgen. But we 
couldn't annotate the source as in cython and then we lose the nice quality of 
being able to gradually annotate the source and export the improved annotations 
to stubs. I suppose we better keep the pyarrow-stubs approach for dynamically 
generated functions. What do you think?
   
   > But in general, I was talking about the _cython_ files. As an example, see 
the second commit in #51681, which adds some additional type annotations in the 
cython file (for things that the stubgen cannot infer from the cython type 
defs), and so are then included in the generated stub file.
   
   Right, for these it should be great.
   
   Do these two styles (dynamically generated and cython) overlap in the 
namespace a lot? Would this make the annotation complex?


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

Reply via email to