New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
py domain: All :py:*
roles can refer python objects even if objtype not matched.
#7243
Comments
…hing obj All py roles does not check objtypes on searching. So they can refer all kind of python objects even if objtype not matched.
…doc#7243) All :c:*: roles can refer all kind of C objects even if objtype not matched. To search objects correctly, this change the form of key for objects to a pair of objtype and objname.
All :c:*: roles can refer all kind of C objects even if objtype not matched. To search objects correctly, this change the form of key for objects to a pair of objtype and objname.
I found same problem in C domain:
|
All :c:*: roles can refer all kind of C objects even if objtype not matched. To search objects correctly, this change the form of key for objects to a pair of objtype and objname.
First: @tk0miya, thanks for all the work and maintenance! It's really nice. I'll look more closely at the C domain soon(TM), but just a few semi-relevant comments for now. This is definitely an issue that should be resolve in each domain, though I'm not entirely sure it should be solved in the same style everywhere, nor that it shouldn't be. Different languages/domains may have different semantics that begs for different resolutions. .. py:function:: foo
:py:meth:`foo`, great, role type matches the object it resolves to
:py:class:`foo`, warning, target ``foo`` is a function but the xref role is a class That is, the second xref becomes the exact same link** as the first. This is the scheme I implemented in the C++ domain.
|
Agreed. I don't think all domains are fixed as same. Now I wonder this fix is really helpful to Python. For example, we have a discussion about attributes and properties (refs: #7068). They are different in implementation, but behave almost same. Other case, we received a post about In python, everything is an object. Variables, functions and classes are all objects. And we don't need to know the some object is either a function, a class or an instance. For example, Therefore, my proposal in this issue would be correct. But it would also be uncomfortable restriction for python developers. I reconsider again what we should do for python domain especially. Note: On the other hand, I feel no problem for C domain to fix this. |
…hing obj All py roles does not check objtypes on searching. So they can refer all kind of python objects even if objtype not matched.
Closing this now. I think this will harm users. |
Describe the bug
py domain: All
:py:*
roles can refer python objects even if objtype not matched.To Reproduce
Both
:py:meth:
and:py:class:
are converted into hyperlinks to.. py:function:: foo
.Expected behavior
They fails to create hyperlinks for python object when objtype is different.
Your project
N/A
Screenshots
N/A
Environment info
The text was updated successfully, but these errors were encountered: