Uh oh!
There was an error while loading. Please reload this page.
BUG: Replaced default parameter [] by None and made some simplifications - #9
BUG: Replaced default parameter [] by None and made some simplifications#9che85 wants to merge 3 commits into
Conversation
…tains or json_are_same several times, setting lists to None instead of [] for reference see http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments
| def _are_same(expected, actual, ignore_value_of_keys, ignore_missing_keys=False): | ||
| # Check for None |
There was a problem hiding this comment.
Here you might want to add something like "allowAdditionalKeys"
- added missing attributes - fixed json comparison script (for the reference ChannelIQ/jsoncompare#8 and ChannelIQ/jsoncompare#9)
Hi Christian, I am the original author but now work at a new company (my own, https://flair.co !) and was wondering if it makes sense to fork this under a non-corporate account? Happy to fork it over to mine or something or leave it as is but I think ChannelIQ was acquired and I have no idea who is in charge of the account anymore. Anyhow, not sure of best practice but open to ideas and suggestions! I had fun writing this code and use it on some of our stuff so happy to continue contributing. |
fedorov
commented
Oct 21, 2016
@dandroid88 I think keeping it under your account is a good idea, and also adding a note in the README about the new location. |
Unexpected behavior might have occurred while running json_are_same several times in a row with different lists.
When using [] as the default value of a list and you run it several times, then the list might look different as you expected it to look like. (see here http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments)