skia-python icon indicating copy to clipboard operation
skia-python copied to clipboard

C++ type names appear in the docstrings

Open HinTak opened this issue 1 year ago • 2 comments

Split off from #261, https://pybind11.readthedocs.io/en/latest/advanced/misc.html#avoiding-cpp-types-in-docstrings

Basically the class declarations need to appear before the methods which involve them. Some can be fixed by init order, such as the Unicode class is only needed/used by the paragraph class, and perhaps the shaper class if it gets more substantial. The rest involves large rearrangements of code, for example canvas has methods involving surface and vice versa, likewise pixmap and image, etc. Some of it will go away as we remove/disable unstable APIs. Probably something to revisit before a non-beta release.

HinTak avatar Aug 28 '24 15:08 HinTak

I wrote a script to split the pybind11 class declarations and method definitions (though the implementation is rather stupid). The whole modification process is in the format_code branch. Maybe it can help.

MeetWq avatar Aug 29 '24 11:08 MeetWq

I had a bit of thought on this - ultimately, all declarations need to go before all definitions, so probably it means splitting and putting the declarations into another (header) file which is included by all. Currently we already have common.h for that.

HinTak avatar Feb 25 '25 20:02 HinTak