Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add hash_merge and hash_merge_recursive filters with documentation #12078
This PR implements the most-requested subset of the earlier (closed) PR
@abadger that's right, I could have done
@bcoca I stuck with
Looks good. We talked about this at the internal team meeting today and implementation seems good. Just want to rename for @bcoca's preference for something neutral. Either merge() and merge_recursive() or combine() and combine_recursive() were suggested. bcoca also thought this would work for other iterables, not just dictionaries which is why he wanted the more neutral naming. After some discussion he convinced us that hash, dict, and associative array are all jargon (not all of our users know about them) so it would be better to add support for other iterables to these filters and change the name rather than keep the name and keep the filters limited to only dicts.
I can make those changes after merge if you want or you can do it yourself and then I'll merge. Let me know your preference. I think I may have an idea of how to get recursive to work as a parameter too that I might try. Something like:
def combine(*terms, **kwargs): recursive = kwargs.get('recursive', False) if len(kwargs) > 1 or ('recursive' not in kwargs and len(kwargs) == 1): # Error about invalid parameter
added a commit
this pull request
Aug 27, 2015
Phew! Thank you to everyone who worked on this problem! And thank you to @amenonsen for seeing it through to completion!
This has been merged in, and will also be included in the next major release.
If you or anyone else has any further questions, please let us know by stopping by one of the two mailing lists, as appropriate:
Because this project is very active, we're unlikely to see comments made on closed tickets, but the mailing list is a great way to ask questions, or post if you don't think this particular