DAWG icon indicating copy to clipboard operation
DAWG copied to clipboard

Duplicate keys in BytesDAWG

Open EgorLakomkin opened this issue 10 years ago • 2 comments

I need to store multiple values by the same key. When I tryed to use BytesDAWG and invoke keys I receive multiple equal keys. Is this correct behaviour?

Here is an example:

import dawg
data = [(u'key1', b'value1'), (u'key2', b'value2'), (u'key1', b'value3')]
bytes_dawg = dawg.BytesDAWG(data)
keys = bytes_dawg.keys( u'key1' )
print keys

The output is:

[u'key1', u'key1']

EgorLakomkin avatar Apr 18 '14 10:04 EgorLakomkin

Hi @EgorLakomkin,

I think it makes sense not to return duplicate keys. PRs are welcome :)

kmike avatar Apr 18 '14 10:04 kmike

Ok, I thought it was made intentionally. I will work on PR :)

EgorLakomkin avatar Apr 18 '14 11:04 EgorLakomkin