Repository navigation
Print dictionaries that contain set values - #741
Open
ibondarenko1 wants to merge 1 commit into
Open
ibondarenko1 wants to merge 1 commit into
ibondarenko1 wants to merge 1 commit into
Conversation
Signed-off-by: Ievgen (Jack) Bondarenko <ibondarenko@student.sierracollege.edu>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Python Fire supports sets and frozensets as values, but a dictionary returned
by a command is classified as a command group when one of its values is a set
or frozenset. Fire then prints a GROUPS help page instead of the command's
result.
value_types.IsSimpleGroup()already accepts nested lists and dictionaries.Add sets and frozensets to the same output path.
Reproduction
On the base revision, this prints a GROUPS help page listing
items. With the patch it printsitems: {1}. A list value printsitems: [1, 2]on both revisions.Testing
python -m pytest -q fire/core_test.py- 30 passed.python -m pytest -q fire/parser_test.py fire/helptext_test.py- 61 passed.pylint fire/value_types.py fire/core_test.py- 10.00/10.failures occur on the unmodified base (temporary-file reopening and an
invalid
\pregex escape in an existing assertion).Fixes #740.