Aug-22-2019, 04:22 AM
def func(*items): print(type(items)) a=list(items) print(type(a)) a[3]= 1026 for i in a: print i items=[1,3,7,9,-99,555,88] func(*items[:])I am trying to pass a list into *args(*items) and it insists on unpacking it into a tuple, whose immutability makes manipulation of data nigh impossible without converting it into a list.
In all examples I see the default usage of *args is to print, or do some things fairly useless. Being new, I might have overlooked something blazingly obvious - which is why I put this question here:
Is conversion to tuple in *args functions default behaviour for list(array) arguments?
And is there a simple way to call variable arguments and have them default to mutable data types? A decorator?