Unexpected behaviour of __contains__ while used on words coming from a Channel

Issue #107 resolved
David Lucas repo owner created an issue

I noticed the following :

F = GF(59)
n, k = 40, 12
C = GeneralizedReedSolomonCode(F.list()[:n], k)
Chan = channels.StaticErrorRateChannel(C.ambient_space(), 2)
A = C.ambient_space()
c = C.random_element()
res = c in C
assert res == True, "Failure at test 1"

works fine, this one either :

w = A.random_element()
contains = w in C
syndrome = (C.syndrome(w) == 0)
assert contains == syndrome, "Failure at test 2, %s, %s" % (contains, syndrome)

while this one

c = C.random_element()
y = Chan(c)
contains = y in C
syndrome = (C.syndrome(y) == 0)
assert contains == syndrome, "Failure at test 3, %s, %s" % (contains, syndrome)

fails dismally...

I'm investigating on the cause, but it's definitely something that needs a fix ASAP.