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 tim.peters
Recipients Y3Kv Bv, tim.peters
Date 2020-01-14.23:01:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1579042872.09.0.341100384678.issue39338@roundup.psfhosted.org>
In-reply-to
Content
What, exactly, in the output shows "the problem"?  When I run it, the `a == b` part is always True, while `len(x)` and `len(crazyQuilt2)` are always 30.  The other three (len(coordinates), len(x2), len(x3)) are always equal to each other, but are monotonically non-increasing across output lines.  For example, a typical block of output lines:

(True, 30, 30, 30, 30, 30)
(True, 30, 30, 30, 30, 30)
(True, 30, 30, 30, 30, 30)
(True, 30, 30, 30, 30, 30)
(True, 19, 30, 30, 19, 19)
(True, 19, 30, 30, 19, 19)
(True, 19, 30, 30, 19, 19)
(True, 12, 30, 30, 12, 12)
(True, 12, 30, 30, 12, 12)
(True, 12, 30, 30, 12, 12)

None of that surprises me.  Exactly what about it surprises you?  Or do you get different kinds of output (and, if so, exactly what?)?

Here's my guess:  you _intended_ these two lines:

          crazyQuilt2[coordinate2Index] = crazyQuilt2[index]
          crazyQuilt2[index] = crazyQuilt2[coordinate2Index]

to _swap_ the values at indices `index` and `coordinate2Index`.  But they don't.  They copy the value originally at `index` into the `coordinate2Index` position, and leave the value originally at `index` untouched.

As more copies randomly build up, anything that builds a set or dict out of the list naturally gets smaller.
History
Date User Action Args
2020-01-14 23:01:12tim.peterssetrecipients: + tim.peters, Y3Kv Bv
2020-01-14 23:01:12tim.peterssetmessageid: <1579042872.09.0.341100384678.issue39338@roundup.psfhosted.org>
2020-01-14 23:01:12tim.peterslinkissue39338 messages
2020-01-14 23:01:11tim.peterscreate