treedict icon indicating copy to clipboard operation
treedict copied to clipboard

hasattr prevents pickling of treedict objects

Open antonbass opened this issue 9 years ago • 1 comments

There seems to be a side effect of calling the python builtin function hasattr on a treedict object that prevents it from pickling:

To recreate:

from pickle import dumps
from treedict import TreeDict
x = TreeDict(y=1)
dumps(x) # this works first time
hasattr(x,'something_random')  # returns True, incorrectly
dumps(x) # crashes during pickling

antonbass avatar Jun 26 '15 16:06 antonbass

Hmmm... I will look at this. Apologies for not responding earlier. This is odd.

hoytak avatar Sep 02 '15 18:09 hoytak