hoytak / treedict

TreeDict is a fast, flexible and full-featured hierarchical python container that makes simple and sophisticated bookkeeping easy.
http://www.stat.washington.edu/~hoytak/code/treedict/
Other
30 stars 9 forks source link

hasattr prevents pickling of treedict objects #9

Open antonbass opened 9 years ago

antonbass commented 9 years ago

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
hoytak commented 9 years ago

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