Serhiy Storchaka <[email protected]> added the comment:
It is expected behavior. Your code is equivalent to:
_result = []
for i in your_list:
_result.append(your_list.append(i))
which is equivalent to:
_result = []
_j = 0
while _j < len(your_list):
i = your_list[_j]
_result.append(your_list.append(i))
_j += 1
It is an infinite loop (because len(your_list) is increased after
your_list.append(i)), and two lists grow with every iteration.
----------
nosy: +serhiy.storchaka
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue45579>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com