Skip to content
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

Closed
wants to merge 1 commit into from
Closed

docs: Add type for icon property of guild #2137

wants to merge 1 commit into from

Conversation

Blue-Robin-Taken
Copy link
Contributor

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

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • This PR is not a code change (e.g. documentation, README, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.

Signed-off-by: Blue-Robin-Taken <[email protected]>
@Blue-Robin-Taken Blue-Robin-Taken requested a review from a team as a code owner June 21, 2023 21:34
@pullapprove4 pullapprove4 bot requested a review from CodeWithSwastik June 21, 2023 21:34
@Blue-Robin-Taken Blue-Robin-Taken changed the title Docs: Add type for icon property of guild docs: Add type for icon property of guild Jun 21, 2023
@@ -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."""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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:

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 ^^

Copy link
Contributor

@OmLanke OmLanke Jul 3, 2023

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

@JustaSqu1d JustaSqu1d requested review from JustaSqu1d and removed request for CodeWithSwastik, mccoderpy and OmLanke July 6, 2023 18:55
Copy link
Member

@JustaSqu1d JustaSqu1d left a 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.

@JustaSqu1d
Copy link
Member

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

@pullapprove4
Copy link

pullapprove4 bot commented Jul 27, 2023

Please add a changelog entry

@Blue-Robin-Taken Blue-Robin-Taken deleted the add-type-icon-guild branch July 28, 2023 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants