BitSet &Redis

Christian mining.facts at
Wed Mar 7 23:02:51 CET 2012

I play around with redis. Isn't it  possible to handle BitSet with
Python "as" in Java?

BitSet users = BitSet.valueOf(redis.get(key.getBytes()));

I try something with the struct and bitstring libs , but haven't any
success. Even the follow snippet didn't work, beacause
bitset[0] isn't approriate.

bitset = r.get('bytestringFromRedis')
x =  "{0:b}".format(ord(bitset[0]))

Thanks in advance

More information about the Python-list mailing list