Dear Sphinx developers and users,
Could you please help an issue of linking to some type hints defined in
typing module? The related bigger question is: should the "data" type of
PythonDomain also include the "class" role?
The problem is that Intersphinx has trouble referencing to e.g.
typing.Any in the following:
.. class:: my_package.MyClass(useful_argument)
Say something about MyClass
:param typing.Any useful_argument: document the very useful_argument
Compiling this rST raises ":py:class reference target not found:
typing.Any"
AFAIU, this is due to a fact that typing.Any is defined as an instance
of _SpecialForm, hence it is :py:data:, not :py:class: from
Intersphinx's viewpoint.
Am I missing something, or this is an expected behavior? How can one
reference to typing.Any and other type hints not defined as a class
**inside :param: directive**?
Referencing via :data:`typing.Any` works as expected, though one must
dig through Python docs' objects.inv or typing module source code to
figure the ":data:" part out. Another quick fix was patching
object_types definition in PythonDomain: adding 'class' role to 'data'
object type.
Thank you!
BR,
Zaur Nasibov
--
You received this message because you are subscribed to the Google Groups
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sphinx-users/ae60ee94-67df-7fc6-4270-4faa1fbfbf21%40gmail.com.