Change by Ketan Sharma :
--
nosy: -iitkgp.ke...@gmail.com
___
Python tracker
<https://bugs.python.org/issue36223>
___
___
Python-bugs-list mailing list
Unsub
New submission from Ketan Sharma :
>>> def pola(arr):
... for i, item in enumerate(arr):
... arr[i] = item*item
...
>>> a = [1,2,3,4]
>>> print(a,pola(a),a)
[1, 4, 9, 16] None [1, 4, 9, 16]
I would expect the print statement to execute and print the arguments
Ketan Sharma added the comment:
Realized this is expected behavior. Slight modification to the existing
comments:
Resolution happens in usual order for print(a, pola(a), a).
1) a -> is a reference to the array, resolved as is.
2) pola(a) -> changes the values pointed at by the referen