From f96f6bdf5bc2bab0a2f527eb87de37e17dc1b96f Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 21 Aug 2010 13:25:44 -0400 Subject: [PATCH] Demonstrate issue 1062277 if you serialize the command stack first --- hooke/curve.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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]}] -- 2.26.2