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

Not complete initialization through TestDict.fromdict #3

Closed swayf closed 13 years ago

swayf commented 13 years ago

It seems, I found some small bug...

t = TreeDict.fromdict({'a':1,'b':2})
t.get("c", [])

Gives: File "", line 1, in File "treedict.pyx", line 2293, in treedict.treedict.TreeDict.get (treedict/treedict.c:17819) File "treedict.pyx", line 2322, in treedict.treedict.TreeDict.get (treedict/treedict.c:17711)

In the same time: t = TreeDict() t.update({'a':1,'b':2}) t.get("c", []) works fine :) as it should be.

hoytak commented 13 years ago

Thanks! Fix + tests in commit https://github.com/hoytak/treedict/commit/03cd581f1019dce99d5d421b06305e60133cf6a5. I also added some optimizations for get() when a default parameter is passed (subsequent commits).