changeset 12:ab7d6e908034

Allow cloning.
author David Barts <n5jrn@me.com>
date Fri, 27 Dec 2019 11:39:21 -0800
parents 1f5e471101b0
children 6acda841a690
files runes.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/runes.py	Fri Dec 27 11:26:38 2019 -0800
+++ b/runes.py	Fri Dec 27 11:39:21 2019 -0800
@@ -35,6 +35,8 @@
             self.buffer = array.array('H', self.codec.encode(based_on, 'strict')[0])
         elif based_on is None:
             self.buffer = array.array('H', bytes())
+        elif isinstance(based_on, Runes):
+            self.buffer = array.array('H', based_on.buffer)
         else:
             self.buffer = array.array('H', based_on)