aboutsummaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorGertjan van den Burg <gertjanvandenburg@gmail.com>2016-04-04 13:01:05 -0400
committerGertjan van den Burg <gertjanvandenburg@gmail.com>2016-04-04 13:01:05 -0400
commitc1b5e8f5e8468391f079fe4c4f40ff1fade36d96 (patch)
treef8b7f4941461c902555b4b9ef3b748f133751e8b /Python
parentupdate readme, bump version to 1.0, store first 1000 for future reference (diff)
downloadSyncRNG-c1b5e8f5e8468391f079fe4c4f40ff1fade36d96.tar.gz
SyncRNG-c1b5e8f5e8468391f079fe4c4f40ff1fade36d96.zip
use deepcopy in Python in case a numpy array is used
Diffstat (limited to 'Python')
-rw-r--r--Python/SyncRNG.py3
1 files changed, 2 insertions, 1 deletions
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]