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

© 2023 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘 Mastodon📧 Email