Fixes a bug blocking elections with greater than 256 candidates. The check by Ballot._is_duplicates() to see if there are duplicated candidates on the ballot uses is not instead of !=.
The trouble is that in Python, is compares object identity. Integers in the interval [-5, 256] are singleton objects, and numbers outside that range are not.
a = 10
b = 10
a is b
# True
x = 257
y = 257
x is y
# False
Fixes a bug blocking elections with greater than 256 candidates. The check by
Ballot._is_duplicates()
to see if there are duplicated candidates on the ballot usesis not
instead of!=
.The trouble is that in Python,
is
compares object identity. Integers in the interval[-5, 256]
are singleton objects, and numbers outside that range are not.