This assert works in CPython 2.6 and not in IronPython 2.6.1 RC 1 with a failure
in dumps():
from collections import namedtuple
# verify that instances can be pickled
from cPickle import loads, dumps
Point = namedtuple('Point', 'x, y', False)
p = Point(x=10, y=20)
assert p == loads(dumps(p))
@lists.ironpython.com
Subject: [IronPython] CPickle problem
This assert works in CPython 2.6 and not in IronPython 2.6.1 RC 1 with a failure
in dumps():
from collections import namedtuple
# verify that instances can be pickled
from cPickle import loads, dumps
Point = namedtuple('Point', 'x, y
?
Michael
*From:* users-boun...@lists.ironpython.com
[mailto:users-boun...@lists.ironpython.com] *On Behalf Of *Don Sawatzky
*Sent:* Monday, February 15, 2010 7:41 AM
*To:* users@lists.ironpython.com
*Subject:* [IronPython] CPickle problem
This assert works in CPython 2.6 and not in IronPython 2.6.1
Michael wrote:
Could the namedtuple API be changed to better support IronPython - perhaps an
optional __module__ argument?
That'd be one way to do it - but I'm not sure it helps much compared to just
setting __module__ when you get it back. It would certainly be more
discoverable though.
On 15/02/2010 16:22, Dino Viehland wrote:
Michael wrote:
Could the namedtuple API be changed to better support IronPython - perhaps an
optional __module__ argument?
That'd be one way to do it - but I'm not sure it helps much compared to just
setting __module__ when you get it back.