Thank you very much! I'll post a detailed issue on Github during the weekend.
On Sunday, 1 March 2020 16:03:30 UTC+2, Komiya Takeshi wrote: > > Hi, > > Good point. Indeed, Sphinx expects given type in :param: > info-field-list is a kind of classes. So it would not work for > :py:data: objects. > Could you file an issue to GitHub please? I'll consider the good way > to support them. > > Thanks, > Takeshi KOMIYA > > 2020年2月29日(土) 6:32 Zaur Nasibov <[email protected] <javascript:>>: > > > > 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] <javascript:>. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/sphinx-users/ae60ee94-67df-7fc6-4270-4faa1fbfbf21%40gmail.com. > > > -- 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/d14d8156-eaff-49ab-8fa3-dc44d5c09a46%40googlegroups.com.
