agoragames / leaderboard-python

Leaderboards backed by Redis in Python
https://github.com/agoragames/leaderboard-python
MIT License
156 stars 44 forks source link

member_at returns a member for ranks below 1 #43

Closed ebsaral closed 8 years ago

ebsaral commented 8 years ago

I have a leaderboard with 2994 members in it. lb.member_at(0) should return None, I believe, but it returns {'member': '7694', 'score': 2352.43, 'rank': 25} Accordingly, lb.member_at(-1) returns {'member': '15488', 'score': 2392.103, 'rank': 24}

Is this behaviour normal? Should I control this on my side?

czarneckid commented 8 years ago

@ebsaral Ahhhhh, an indexing bug. I'll look to get this fixed, but you can control this on your side by making sure the index passed in is > 0.