News for hackers. Stuff that matters.
Re:PEP 0448 – Additional Unpacking Generalizations by rectangletangle on Friday July 17, 2015 @10:32PM (#9906372)
I've been wanting this feature for a while as a clean way to combine the results from several queries into a composite object.

    def combined(*dicts):
        return {k: v
                for dict_ in dicts
                for k, v in dict_.items()}

    dicts = [({'a': 'a', 'b': 'b'}, {'b': 'bb'}),]

    assert [{'a': 'a', 'b': 'bb'}] == [combined(a, b) for a, b in dicts]

There are no comments on this comment yet.