[Bf-python] Type annotations and generating stubs

Benjamin Humpherys benjamin.humpherys at gmail.com
Fri Nov 16 07:43:23 CET 2018


One way to make Blender Python development easier to approach would be to distribute `.pyi` files for use with an IDE rather than the obscure and poorly documented process of compiling blender into a Python module. After spending way too many hours unsuccessfully trying to do that I’ve decided I would be better off writing my own .pyi files for the small parts of the API that I am using currently in a project. Perhaps the process of generating the stubs could be automated if the original C/C++ code doc strings were updated to use mypy types. For example, “a list of vertices” would become “List[Vertex]”. 

Are there any plans to begin adding type annotations? Would it make more sense to add them to the doc strings in the C code or maintain a separate directory of manually written pyi stubs?




More information about the Bf-python mailing list