Not sure if this is the root of the issue but __len__() should return an integer, not a string or anything else
__len__()