MCPcopy Create free account
hub / github.com/ActiveState/code / graft

Function graft

recipes/Python/81932_Synchronizing_two_lists/recipe-81932.py:5–7  ·  view source on GitHub ↗

Add all items in the list 'unique_items' from list L

(L, unique_items)

Source from the content-addressed store, hash-verified

3 map(L.remove, unique_items)
4
5def graft(L, unique_items):
6 """Add all items in the list 'unique_items' from list L"""
7 L.extend(unique_items)
8
9def unique(L1, L2):
10 """Return a list containing all items in 'L1' that are not in 'L2'"""

Callers 1

recipe-81932.pyFile · 0.85

Calls 1

extendMethod · 0.45

Tested by

no test coverage detected