On Fri, Mar 13, 2009 at 12:55 PM, Nicolas M. Thiery
<nicolas.thi...@u-psud.fr> wrote:
>
> 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
>> <nicolas.thi...@u-psud.fr> 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.

I certainly wouldn't call it a bug -- at the most, a missing feature.
I'm not even convinced that a patched version would be an improvement.
 (For one thing, you would need to also patch the unpickle side, which
means that you can't write a pickle using your patch and read it in
older versions of Python.  We don't care much about that in Sage, but
I think it's important to the Python people.)

Carl

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to