Preserve the collapse parameter in the remaining recursive callsites without it#15
Open
tsibley wants to merge 1 commit intoduncantl:masterfrom
Open
Preserve the collapse parameter in the remaining recursive callsites without it#15tsibley wants to merge 1 commit intoduncantl:masterfrom
tsibley wants to merge 1 commit intoduncantl:masterfrom
Conversation
…without it Two of the three callsites affected calls to toJSON() with the ANY signature, but the most obvious defect was when calling toJSON() on a list(). The test tries to serialize what could be thought of as a nested hash, and fails if run on the code before this commit.
tsibley
added a commit
to tsibley/rPython
that referenced
this pull request
Aug 4, 2014
The following simplified example now works:
python.assign("foo", list( "key" = c( "subkey" = 13, "anotherkey" = 42 ) ));
A bug in RJSONIO causes toJSON() not to fully-respect the collapse
parameter, so we still do sometimes have newlines despite setting
collapse to the empty string [1]. Using triple single quotes in Python
works around the issue and is more robust anyhow. Prefixing the Python
string with "r" means that literal escape codes in the JSON itself won't
be interpreted first by Python. Both of these issues were addressed in
python.call() in previous commits.
The auto-flattening behaviour is also adjusted to only apply to lists.
len(hash) will equal 1 with only a single key in hash, but it shouldn't
be flattened.
[1] Patch: tsibley/RJSONIO@c9196f8 and
Pull request: duncantl/RJSONIO#15
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.
Two of the three callsites affected calls to toJSON() with the ANY
signature, but the most obvious defect was when calling toJSON() on a
list().
The test tries to serialize what could be thought of as a nested hash,
and fails if run on the code before this commit.