pyopencl icon indicating copy to clipboard operation
pyopencl copied to clipboard

feat: create Python typing stub

Open yxliang01 opened this issue 4 years ago • 2 comments

Since python 3.6, we can add type information to python variables, functions, etc... Having such type information specified can avoid many mistakes early before they lead to runtime error. Since this library wants to maintain its support for python 2.7, adding type annotations to the code in the python modules is infeasible. As a result, stubs can be implemented to provide type information while maintaining backward-compatibility.

More information, https://www.python.org/dev/peps/pep-0484/

yxliang01 avatar Nov 06 '19 15:11 yxliang01

Thanks for the suggestion. I'm not opposed to having type annotations, but I'm unlikely to work on them myself. I'd be happy to take a PR, though.

inducer avatar Nov 06 '19 16:11 inducer

Maybe someone interested and has some few time can work on this then :) Or, maybe when I am more free and more familiar this library (I'm still learning how to use efficiently).

yxliang01 avatar Nov 06 '19 16:11 yxliang01