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
Seems the dict of method for class imported from other modules is ignored during serialization. However, dict is included if the class is created inside the jupyter notebook.
Here is the code to reproduce this:
and this is for class created inside jupyter notebook, inside which I can find the dict for new_obj.f: "0x7970414417c0" appears in the trace, which differs the serialization behavior for imported class method.
Thanks for reporting. I should mention a few things to you: (1) when functions are serialized, they will include globals as a dependency... and you can change the serialization behavior of globals with dill.settings; (2) the serialization of objects that depend on globals is handled differently depending if they are in __main__ or not... and a jupyter notebook cell is technically not __main__, it's a local namespace that, behind the sciences, passes objects defined in a cell up to __main__... so there should be differences between sessions in a notebook and those not in a notebook.
Seems the dict of method for class imported from other modules is ignored during serialization. However, dict is included if the class is created inside the jupyter notebook.
Here is the code to reproduce this:
# my_pkg/__init__.py
when I turn on
detect.trace
, here is the trace for serializing the method for imported classand this is for class created inside jupyter notebook, inside which I can find the dict for new_obj.f: "0x7970414417c0" appears in the trace, which differs the serialization behavior for imported class method.
shoud this be consistent and
__dict__
is always included?The text was updated successfully, but these errors were encountered: