You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use nested defaultdicts to represent sparse matrices. With default settings (i.e., no directives to the backend) on Python 2.7.5 and Python 3.4.1, the outer default_factory is simply not encoded. The following example shows this:
This is wrong: there's no outer default_factory at all. (Note this has nothing to do with the use of a lambda function, as far as I can tell: non-anonymous default_factories behave the same way.)
This also doesn't go round-trip:
mydict_new = jsonpickle.decode(encoded)
print(mydict.default_factory) # prints pointer to the lambda function
print(mydict_new.default_factory) # prints None
The text was updated successfully, but these errors were encountered:
I use nested defaultdicts to represent sparse matrices. With default settings (i.e., no directives to the backend) on Python 2.7.5 and Python 3.4.1, the outer
default_factory
is simply not encoded. The following example shows this:This prints:
This is wrong: there's no outer
default_factory
at all. (Note this has nothing to do with the use of a lambda function, as far as I can tell: non-anonymousdefault_factories
behave the same way.)This also doesn't go round-trip:
The text was updated successfully, but these errors were encountered: