In Python I can extend a list in place like such
mylist = [1,2]
mylist.extend([3])
#or
mylist += [3]
and I can extend a list 'out of place', where it creates a copy, or third list
newList = mylist + [3]
mylist = mylist + [3] #assigns mylist a newly created list
I can append to a list in place:
mylist.append(3)
Is there a clean way to append to a list 'out of place' while avoiding the overhead of wrapping a single object in a list and without using the Copy module?
newList = mylist.append(3) #newList is None here