Skip to content

Conversation

@cosven
Copy link
Contributor

@cosven cosven commented Nov 20, 2017

  1. setbit SHOULD return old_value instead of None
  2. there exists bug when setbit to 0

for example:

# originally
self.redis.setbit('foo', 4, 0)
value = self.redis.getbit('foo', 4)  # we will get 1, but we should get 0

1. setbit SHOULD return old_value instead of None
2. there exists bug when setbit to 0
@adamantike
Copy link
Contributor

I have experienced this same issue. The simplest scenario where current implementation fails is:

def test_getbit_zero(self):
    self.redis.setbit('foo', 1, 0)
    self.assertEqual(self.redis.getbit('foo', 1), 0)

@jamesls can you please consider merging this fix?

@jamesls jamesls merged commit 2589290 into jamesls:master Mar 9, 2018
@mrnovalles
Copy link

Could you release a patch version now that this fix is merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants