docs: switch to sphinx-autodoc-typehints by aucampia · Pull Request #1854 · RDFLib/rdflib (original) (raw)
Difference illustrated below:
- master branch: https://rdflib.readthedocs.io/en/latest/apidocs/rdflib.html#rdflib.graph.Graph.add

- PR branch: https://rdflib--1854.org.readthedocs.build/en/1854/apidocs/rdflib.html#rdflib.graph.Graph.add

Again, the reason why sphinx-autodoc-typehints is mainly because it also resolves type aliases, and then shows the underlying types instead of the alias name, so if the type hint was _TripleType, and _TripleType = Tuple[Node, Node, Node], then sphinx-autodoc-typehints will put Tuple[Node, Node, Node] in the docs instead of _TripleType. This is primarily so that #1853 does not result in confusing documentation, once this is merged I will rebase that so that the docs can be reviewed with this in place.