durabledict icon indicating copy to clipboard operation
durabledict copied to clipboard

Why the keys are converted to string?

Open ecarreras opened this issue 12 years ago • 5 comments

Python dict:

d = {}
d[1] = 'test'
{1: 'test'}

With RedisDict:

d = RedisDict('foo', conn)
d[1] = 'test'
{'1': 'test'}

ecarreras avatar Feb 15 '14 23:02 ecarreras

This appears to just be an oversight. The zookeeper dict also has this same problem. I'll look at fixing this over the weekend.

Fluxx avatar Feb 16 '14 22:02 Fluxx

I developed a library that looks like durabledict, but it's focused on MongoDB: mongodict.

I solved these problems using tests from the Python source code (the mapping protocol). Maybe adding this file to your test suite will help discovering these problems.

turicas avatar Feb 17 '14 15:02 turicas

As a heads up I'll be working on this library today, improving the serialization/deserialization configurability and support - so I should be able to fix this issue and a few others.

Fluxx avatar Jul 21 '14 18:07 Fluxx

This is slightly more annoying in python3 where you use an unicode string as key and you get back a byte string.

xrmx avatar Nov 26 '15 13:11 xrmx

it's 2018, is this dead?

gordol avatar Aug 31 '18 20:08 gordol