I'd like to fill a list with numbers from 0 to 999, except a certain number. But it looks like the certain number can be from 0 to 256 only; if it's anything over 257 or greater, "if i is not ..." part is ignored. Would someone explain why this is so in Python (both 2.x and 3.x)?
>>> l = [i for i in range(1000) if i is not 255]; len(l)
999
>>> l = [i for i in range(1000) if i is not 256]; len(l)
999
>>> l = [i for i in range(1000) if i is not 257]; len(l)
1000
>>> l = [i for i in range(1000) if i is not 258]; len(l)
1000