From c1b5e8f5e8468391f079fe4c4f40ff1fade36d96 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Mon, 4 Apr 2016 13:01:05 -0400 Subject: use deepcopy in Python in case a numpy array is used --- Python/SyncRNG.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Python') diff --git a/Python/SyncRNG.py b/Python/SyncRNG.py index 7ef6fd6..0ab4c06 100644 --- a/Python/SyncRNG.py +++ b/Python/SyncRNG.py @@ -6,6 +6,7 @@ used to seed and pull numbers from the RNG. from __future__ import division +from copy import deepcopy from warnings import warn as _warn import syncrng @@ -40,7 +41,7 @@ class SyncRNG(object): return int(r*maxsize) % n def shuffle(self, x): - y = x[:] + y = deepcopy(x) for i in reversed(range(1, len(y))): j = self.randbelow(i+1) y[i], y[j] = y[j], y[i] -- cgit v1.2.3