Package logilab-common-0 :: Package 39 :: Package 0 :: Module patricia :: Class PatriciaNode
[frames] | no frames]

Class PatriciaNode

source code

a PATRICIA trie node
    

Instance Methods
 
__init__(self, value='', leaf=0, data=None) source code
 
insert(self, string, data)
insert the string in the trie and associate data to it...
source code
 
remove(self, string)
return datas associated with string and remove string from the trie...
source code
 
lookup(self, string)
return datas associated with string...
source code
 
pfx_search(self, pfx, depth=-1)
return all string with prefix pfx
source code
 
__str__(self, indent='') source code
 
__repr__(self) source code
Method Details

insert(self, string, data)

source code 
insert the string in the trie and associate data to it
if the string exists is the trie, data is added to the existing datas

remove(self, string)

source code 
return datas associated with string and remove string from the trie
raise KeyError if the key isn't found
FIXME: we should change the trie structure

lookup(self, string)

source code 
return datas associated with string
raise KeyError if the key isn't found