I would like to build a prototype as such:
def foo(a,t=([0]*len(a))):
print t
For reasons that are unimportant at the moment. I am passing in variable length list arguments to . However, Python 2.7.10 on Linux always returns as follows:
>>> a = [1,2,3,4]
>>> foo(a)
[O, 0]
Without the function call, none of this behaves in an unexpected manner. What is happening that causes Python to always think that the passed list is length 2 during variable assignment in foo()?