From: W. Trevor King Date: Sat, 21 Aug 2010 17:25:44 +0000 (-0400) Subject: Demonstrate issue 1062277 if you serialize the command stack first X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f96f6bdf5bc2bab0a2f527eb87de37e17dc1b96f;p=hooke.git Demonstrate issue 1062277 if you serialize the command stack first --- diff --git a/hooke/curve.py b/hooke/curve.py index 9f92e59..5a32e6d 100644 --- a/hooke/curve.py +++ b/hooke/curve.py @@ -197,6 +197,34 @@ class Curve (object): name: path path: some/path + + However, if we try and serialize the command stack first, we run + into `Python issue 1062277`_. + + .. _Python issue 1062277: http://bugs.python.org/issue1062277 + + >>> pickle.dumps(c.command_stack) + Traceback (most recent call last): + ... + assert id(obj) not in self.memo + AssertionError + + YAML still works, though. + + >>> print yaml.dump(c.command_stack) + &id001 !!python/object/new:hooke.command_stack.CommandStack + listitems: + - !!python/object:hooke.engine.CommandMessage + arguments: + curve: !!python/object:hooke.curve.Curve + command_stack: *id001 + data: null + driver: null + info: {} + name: path + path: some/path + command: curve info + """ def __init__(self, path, info=None): #the data dictionary contains: {name of data: list of data sets [{[x], [y]}]