Closed
Description
Currently all values will be converted using int or float_fn in _get_value if it's possible.
This is done regardless of what was actually put in.
This can lead to some hard to spot errors.
Example
v1 = "1234567" # E.g. hash values or something "non controllable"
v2 = "1ab3dc8"
type(v1), v1, type(v2), v2 => (<type 'str'>, '1234567', <type 'str'>, '1ab3dc8')
redis.Redis().set("a", v1)
redis.Redis().set("b", v2)
v1 = redis.Redis().get("a")
v2 = redis.Redis().get("b")
type(v1), v1, type(v2), v2 => (<type 'int'>, 1234567, <type 'unicode'>, u'1ab3dc8')
As you can see the returned values no longer match in type. It's not very intuitive that some values automatically gets converted while other doesn't.
I think it would be more appropriate to always return the non converted values, unless, if made possible, some other type where explicitly provided.
Metadata
Metadata
Assignees
Labels
No labels