announce: make _chunks() helper safe against more input types
#2166
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #2165.
Python 3
dict.keys()returns adict_keysobject, which is not subscriptable unlike the return value in py2.Also made the generator return a consistent type (always tuple), and updated the documentation (not that it's actually used anywhere by Sphinx). Added a test, too, because let's (try to) not have this plugin bite us again.
Checklist
make qa(runsmake qualityandmake test)make qualityon both py3(.8) and py2(.7), and the patch should be clean against both. Since this can't be a straight cherry-pick back to7.1.xdue to the new test file needing different headers, I have pre-prepped anannounce-py2-backportbranch for myself with the appropriate code style.