Add smarts to autodoc_utils for inherited TypedDicts.
Review Request #14480 — Created June 27, 2025 and submitted — Latest diff uploaded
TypedDictinheritance is weird in a way that Sphinx can't deal with
easily.TypedDictisn't actually a class itself, and things which
inherit from it get flattened to inherit directly fromdictand have a
variety of annotation-only properties for the data inside. Sphinx can
find any documentation attached to those properties, but when one
inherits from another, the documentation for any properties coming from
the parent class gets lost.This change adds some custom documenter classes to detect when we have
inherited TypedDict members and to scan up the chain using
__orig_bases__to find docs for inherited members.This requires Python 3.11+ if using
typing.TypedDict. It works for all
versions when usingtyping_extensions.TypedDict.
- Built the RBTools documentation with this and saw that all of our new
*Paramsdefinitions had documentation for all members, including ones
inherited from parent classes. - Ran unit tests.