I was searching for questions to answer and I found this one: Shuffling list of dictionnaries always return the same list noticed it is labelled to be duplicate of How to clone or copy a list?
I would like to object. The person thinks that there's something wrong with his shuffling, and doesn't realize that it's the problem in copying.
I think the question should be answered with:
new_dict = dict_student
doesn't create a copy, it just creates another reference to the same list object. See the duplicate
as it is in a comment, with See the duplicate
replaced with
See the answer to How to clone or copy a list?
If someone has the same problem, they will not search for question about copying; they will search for questions that mention shuffling
, potentially only those that have answers. So, they will not find this question, because it doesn't have an answer.
The only reason I stumbled across this question is because it was not answered. If this was my problem, I would search for questions with answers, and so I would not find this one.
Thus I think this question is related to the older question, but not really a duplicate.
If someone has the same problem, they will not search for question about copying; they will search for questions that mention shuffling, potentially only those that have answers. So, they will not find this question, because it doesn't have an answer.
part.random.shuffle(new_dict)
line is absolutely not necessary... and hence they question not about shuffle at all... But requiring to put an effort is borderline not welcoming - so now it is your responsibility to edit post to make it clear - by either removing shuffle part or adding another duplicates that cover all variations.