On Fri, Mar 13, 2009 at 11:37:34AM -0700, Carl Witty wrote:
>
> On Fri, Mar 13, 2009 at 1:03 AM, Nicolas M. Thiery
> <[email protected]> wrote:
> > But then, a second problem: the code of cPickle (around line 1977)
> > tries to lookup the attribute "Bla.Ble" in __main__, instead of
> > successively looking up "Bla" in __main__, and then "Ble" in the result:
>
> May I suggest a different workaround? (It's gross, but maybe less
> gross than changing cPickle.)
>
> sage: __main__.__dict__['Bla.Ble'] = Bla.Ble
> sage: loads(dumps(x))
> <__main__.Bla.Ble instance at 0x1a2e7eac>
Well, that's a bug in python that should eventually be fixed in
python. But yeah, your workaround could be a good way out.
Thanks!
Now, you don't have by any chance a magic spell, so that whenever such
a nested class Foo.Bar is created, 'Foo.Bar' gets inserted in its
module as above? (I guess I can hack around for my application).
Cheers,
Nicolas
--
Nicolas M. ThiƩry "Isil" <[email protected]>
http://Nicolas.Thiery.name/
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---