-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Fix inspect.Parameter docstring on the kind attribute
#143541
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
base: main
Are you sure you want to change the base?
Fix inspect.Parameter docstring on the kind attribute
#143541
Conversation
inspect.Parameter docstring on the kind attribute
|
Is it just a C/C from the online docs? |
No, not at all |
|
Then I am a bit confused about the change. When I asked C/C from the online docs, I wanted to know whether the online docs indicated the description field and that 'kind' was an enumeration. |
|
The online documentation does not specifiy whether
What makes it confusing? What can I do? |
|
I am confused by "the docstring was wrong". AFAICT, it is not wrong. If you indicate that kind is an enum in te docstring it should be reflected in the online docs as well. |
| parameter has no annotation, this attribute is set to | ||
| `Parameter.empty`. | ||
| * kind : str | ||
| * kind : int (enum) |
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.
@picnixz, kind : str is wrong. It is never a string.
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.
Ah! I missed this change! my bad!
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.
Ah! I missed this change! my bad!
It is not explicitly reflected. Online docs don't annotate types as this docstring does. |
|
What can I do to address the concerns about the PR? |
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.
Ok I actually missed the fact that it was documented as a string...
As a follow-up, I would suggest that:
- You explicitly mention that it is an enumeration in the docs.
- You explicitly say that it has a description property.
We could document the enumeration as well as a class right? (or is it an implementation detail?)
I've checked the docs and they're correct; only the docstring was wrong.
I think we can use this pseudocode type annotation here? Open for a better idea.