Closed enzzc closed 8 years ago
Good catch!
I believe I fixed this last night by using the pickle
module. Instead of converting everything to a string I'm pickling the object and un-pickling it when we load back from Redis. I would like to stay away from specifying a type to store since that to me seems less 'pythonic' FWIW.
I'm not sure if there are any limitations to using pickle
but it seems to work with most objects/types.
Yes, specifying a type would not be very pythonic... I've just pulled the changes, the pickle solution seems to work perfectly!
Great! Let me know if you have any other issues :)
Cached values seem to be always retrieved and returned with type
str
. This can be a problem when a function is expected to return anint
for example.What would be the best way to force a certain return type?