Add empty separator check and tests
str.split method does not accept an empty string as a separator:
>>> 'foo'.split('') Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: empty separator >>>Add an explicit test in the StringTrie constructor so we fail early when constructing the object.
(As an aside, str.split allows None as a separator. StringTrie could allow None separator but _key_from_path would have to be changed. If anyone needs that feature it’s fairly easy to implement).
[mina86@mina86.com: expanded commit message]
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号