manifold icon indicating copy to clipboard operation
manifold copied to clipboard

Auto generated python stubs inconsistent with cpp API

Open t-fi opened this issue 7 months ago • 2 comments

This is a stellar project, I love it! I originally came here looking for a replacement for OpenSCAD's proprietary language. And I found a little gem :)

Now, here's a technical aspect I would like to hear the authors's / maintainer's thoughts on:

Following the stub generation from bindings/python/README.md via nanobind-stubgen manifold3d I observe that the stubs don't properly reflect the API.

I do believe it is mostly a limitation of nanobind, however manifold3d can make an informed decision on whether to improve the situation.

My main issue with the stubs is that any IDE / linter / etc. will be confused, impairing the manifold3d python library user experience. For example, the Manifold cpp class has a few static constructors. Those are not marked as @staticmethod in manifold.pyi. Also, the operators for boolean combinations are not included in the the stub file (i.e. __add__ etc. are missing).

I know that there are bindings for a couple of languages, and that this is not a first class python project. Still, solid stubs could greatly improve the developer experience when using the python package.

t-fi avatar Jul 05 '24 21:07 t-fi