-
-
Notifications
You must be signed in to change notification settings - Fork 11.9k
DOC: Ensure that we add documentation also as to the dict for types #18775
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
Conversation
|
OK, this doesn't quite seem to work, because it overshadows the getset of the instance? Hmmm... EDIT: Well, maybe the solution is to add a special case just for |
|
Are metaclasses related at all here, or is this just a heap type problem? |
|
@eric-wieser yeah, that would make sense, but I am not setting the HEAPTYPE flag on |
|
close/reopen |
This ensures that `help(np.dtype)` produces a result. I am not exactly sure why it picks up `__doc__` from the dict instead of `tp_doc` right now. It probably is due to the combination of inheritance and the fact that the dict always includes `None` and gets preference during inheritance. (That probably makes a lot of sense to not inherit the `type` docstring by default.) Modifying the dictionary directly is not really good style, either, but hopefully works. Closes numpygh-18740
abf8ffd to
9975cc8
Compare
|
After chasing around how ufuncs add docstrings (we have a function to do it via Python, which claims it is used but is not actually used)... The only thing that was necessary here was to only put the doc-string into the dict only if the dict contains This actually means/fixes that |
WarrenWeckesser
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @seberg. I noticed one small typo.
Co-authored-by: Warren Weckesser <[email protected]>
|
Thanks @seberg. |
This ensures that
help(np.dtype)produces a result. I am notexactly sure why it picks up
__doc__from the dict instead oftp_docright now. It probably is due to the combination ofinheritance and the fact that the dict always includes
Noneand gets preference during inheritance.
(That probably makes a lot of sense to not inherit the
typedocstring by default.)
Modifying the dictionary directly is not really good style, either,
but hopefully works.
Closes gh-18740