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 terry.reedy
Recipients paul.moore, steve.dower, terry.reedy, tim.golden, yepan Li, zach.ware
Date 2020-03-20.23:36:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1584747380.06.0.225322877201.issue40022@roundup.psfhosted.org>
In-reply-to
Content
Test01.py runs as expected with no exceptions.  This issue appears to be based on a misunderstanding of one or both of two things:
a) multiplying an empty list does nothing other than returning a new empty list.
b) list.insert(index, value) treats the index as a slice index.  This is specified in the doc by "same as s[index:index] = [value]". (I spelled out the parameter names.)
https://docs.python.org/3/library/stdtypes.html#mutable-sequence-types

>>> l1, l2 = [], []
>>> l1.insert(6, 0); l2[6:6] = [0]
>>> l1, l2
([0], [0])
History
Date User Action Args
2020-03-20 23:36:20terry.reedysetrecipients: + terry.reedy, paul.moore, tim.golden, zach.ware, steve.dower, yepan Li
2020-03-20 23:36:20terry.reedysetmessageid: <1584747380.06.0.225322877201.issue40022@roundup.psfhosted.org>
2020-03-20 23:36:20terry.reedylinkissue40022 messages
2020-03-20 23:36:19terry.reedycreate