-
-
Notifications
You must be signed in to change notification settings - Fork 467
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
docs: Add type for icon property of guild #2137
docs: Add type for icon property of guild #2137
Conversation
Signed-off-by: Blue-Robin-Taken <[email protected]>
@@ -949,7 +949,7 @@ def owner(self) -> Member | None: | |||
|
|||
@property | |||
def icon(self) -> Asset | None: | |||
"""Returns the guild's icon asset, if available.""" | |||
"""Returns the guild's icon asset of type :class:`asset.Asset`, if available.""" |
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.
Can this not use the rtype
directive?
https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html#the-sphinx-docstring-format
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.
Something like :class:~discord.Asset
should work fine. But I can't see any place in the PyCord docs where poperty return types are mentioned in the docstring.
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.
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.
Wouldn't it be :type:
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.
No, :type: isn't a thing by default, and types are mostly classes ^^
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.
:type <param>:
directive is to specify the type of a parameter. :rtype
is to specify the return type.
See this https://www.sphinx-doc.org/en/master/tutorial/describing-code.html#documenting-python-objects
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.
This doesn't seem to tackle the main problem. Currently, all properties do not have types, and this doesn't actually solve the core issue.
See #2141 |
Please add a changelog entry |
Summary
When I used this property, it took me a bit of time to find it's type. So, I believe it would be good to add it in the documentation.
Information
examples, ...).
Checklist
type: ignore
comments were used, a comment is also left explaining why.