This is an archive of the discontinued LLVM Phabricator instance.

[lldb][docs] Force documentation emission of special Python class members
ClosedPublic

Authored by teemperor on Jul 6 2021, 7:05 AM.

Details

Summary

The current LLDB Python docs are missing documentation for all the special members such as
conversion functions (__int__) and other special functions (__len__).

The reason for that is that the automodapi plugin we're using to generate the *.rst files simply
doesn't emit them. There doesn't seem to be any config option to enable those in automodapi
and it's not even clear why they are filtered. I assume the leading underscore in their names
makes them look like private methods.

This patch just forcibly adds a few selected special members functions to the list of functions
that sphinx should always document. This will cause sphinx to warn if a class doesn't have one of those
functions but it's better than not having them documented.

The main motivation here is that since SBAddress.__int__ is one of the few functions that is
only available in the embedded Python REPL which would be good to have in the public documentation.

Fixes rdar://64647665

Diff Detail

Event Timeline

teemperor requested review of this revision.Jul 6 2021, 7:05 AM
teemperor created this revision.

I think the proper fix here is to send a patch to the automodapi folks, but that will take a while...

teemperor edited the summary of this revision. (Show Details)Jul 6 2021, 7:08 AM
JDevlieghere accepted this revision.Jul 6 2021, 9:56 AM

LGTM. 🚢 it.

This revision is now accepted and ready to land.Jul 6 2021, 9:56 AM