This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients Spencer Brown, serhiy.storchaka, txlbr
Date 2021-10-23.08:03:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1634976184.79.0.00520761830035.issue45579@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2021-10-23 08:03:04serhiy.storchakasetrecipients: + serhiy.storchaka, Spencer Brown, txlbr
2021-10-23 08:03:04serhiy.storchakasetmessageid: <1634976184.79.0.00520761830035.issue45579@roundup.psfhosted.org>
2021-10-23 08:03:04serhiy.storchakalinkissue45579 messages
2021-10-23 08:03:04serhiy.storchakacreate