pytries / datrie

Fast, efficiently stored Trie for Python. Uses libdatrie.
http://pypi.python.org/pypi/datrie/
GNU Lesser General Public License v2.1
530 stars 88 forks source link

validate keys at insertion time #6

Open kmike opened 12 years ago

superbobry commented 9 years ago

Currently inserting a key with non-mapped letters leads to a no-op. Maybe we should validate the key and throw a ValueError in this case.

>>> import datrie
>>> trie = datrie.Trie("a")
>>> trie["ab"] = 42
>>> len(trie)
0