0

Sphinx allows linking to external documentation (such as the standard library docs) via intersphinx.

Is it possible to link to the definition of special methods like __del__(), without just making a regular link?

AstraLuma
  • 609
  • 5
  • 16

1 Answers1

0

Ok, so in my case, I just needed to link to the object.__del__ method:

:py:meth:`__del__() <object.__del__>`

To do this generically:

  1. Use python -m sphinx.ext.intersphinx https://docs.python.org/3/objects.inv to get the inventory of the python docs. You're gonna want to pipe the output through less or grep or save it to a file
  2. Search through the results for the thing you're looking for. For special methods, it'll probably be object.__spam__
  3. Look at the section the thing is under, and add it to your rst
AstraLuma
  • 609
  • 5
  • 16