You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the :show-inheritance: option for automodule, autoclass, or autoexception directives, the qualname overrides specified for elegant_typehints are not processed by Sphinx. The :show-inheritance: option will make Sphinx also list the base classes (and link them) for each class. However, since the qualname_overrides aren't processed, using the :show-inheritance: option will throw errors for classes whose base classes' qualnames should be overridden.
This will throw an error because requests.ConnectionError's qualname is requests.exceptions.ConnectionError but the object inventory exposes requests.ConnectionError... which is the reason why we'd use qualname_overrides from elegant typehints. The expected behavior is that elegant typehints should handle this case as well.
P.s. on another note, this may actually be expected as it's not related to type hints. Still, I wonder if we can elevate the qualname overrides feature into something more general, maybe as its own extension.
When using the
:show-inheritance:
option forautomodule
,autoclass
, orautoexception
directives, the qualname overrides specified forelegant_typehints
are not processed by Sphinx. The:show-inheritance:
option will make Sphinx also list the base classes (and link them) for each class. However, since thequalname_overrides
aren't processed, using the:show-inheritance:
option will throw errors for classes whose base classes' qualnames should be overridden.For example, with the following rst file:
and the following
mypackage/exceptions.py
:This will throw an error because
requests.ConnectionError
's qualname isrequests.exceptions.ConnectionError
but the object inventory exposesrequests.ConnectionError
... which is the reason why we'd usequalname_overrides
from elegant typehints. The expected behavior is that elegant typehints should handle this case as well.Link to Sphinx's
autoclass
inheritance checking implementation:https://github.com/sphinx-doc/sphinx/blob/3.x/sphinx/ext/autodoc/__init__.py#L1485-L1494
The text was updated successfully, but these errors were encountered: