Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Python: Making a completely unshared copy of list

📅 2009-Oct-22 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ copying, lists, python ⬩ 📚 Archive

Also see: http://stackoverflow.com/questions/1601269

def unsharedListCopy(inList):
    if isinstance(inList, list):
        return list( map(unsharedListCopy, inList) )
    return inList