Skip to content

Conversation

@jacquerie
Copy link
Collaborator

Adds support for listing the topics of a repository, as described in
https://developer.github.com/v3/repos/#list-all-topics-for-a-repository,
or replacing them with a new list of topics, as described instead in
https://developer.github.com/v3/repos/#replace-all-topics-for-a-repository.

Adds support for listing the topics of a repository, as described in
https://developer.github.com/v3/repos/#list-all-topics-for-a-repository,
or replacing them with a new list of topics, as described instead in
https://developer.github.com/v3/repos/#replace-all-topics-for-a-repository.
@jacquerie jacquerie force-pushed the add-support-for-repository-topics branch from 447c61c to 07a0b4a Compare July 13, 2018 02:55
@jacquerie jacquerie closed this Jul 13, 2018
@jacquerie jacquerie reopened this Jul 13, 2018
.. attribute:: names

The names of the topics.
"""
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

WDYT of adding an __iter__ and a __len__, so that essentially Topics becomes a facade of its names attribute? I didn't do it outright as this pattern (AFAICT) is not used elsewhere in the code base.

Copy link
Owner

Choose a reason for hiding this comment

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

I'd rather not. As you mentioned we don't have that precedent anywhere else.

Further, if GitHub adds more attributes to this endpoint (which I'm guess they will based on the structure of the JSON [1]) then iterating over the Topics object will be more confusing.

It almost feels like we shouldn't have an object for this, but again, I suspect they'll be expanding the response without telling anyone.

[1] I'm assuming that they haven't given up on consistency for the API behaviour which is what this looks like on first blush.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Further, if GitHub adds more attributes to this endpoint [...] then iterating over the Topics object will be more confusing.

Good point, that's an excellent argument for avoiding this magic 👍

@opendev-zuul
Copy link

opendev-zuul bot commented Jul 13, 2018

Build succeeded (third-party-check pipeline).

@sigmavirus24
Copy link
Owner

Thank you! This is fantastic!

@sigmavirus24 sigmavirus24 merged commit bb40e7e into sigmavirus24:develop Jul 13, 2018
@jacquerie jacquerie deleted the add-support-for-repository-topics branch July 13, 2018 13:00
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.

2 participants