Yoooooooooo !!

> You can still iterate over *some* elements.

Indeed. My problem with Words(2) is the following :

- If you iterate on it, you just get finite words
- Words(2).random_element() breaks right now, which is fixed in #12867.
There are two patches there, but if you use mine  call to random_element()
gives you an infinite binary word in return (which I find totally cool).

And so it feels weird to have Word(2).__iter__ only give you finite words,
while (let's face it) "most" binary words are infinite :-PPPP

> You can't iterate over all
> elements, but so what? Neither can you iterate on a computer over all
> elements of an infinite but countable set, nor is it feasible to iterate
> over all elements of finite but very large sets.

Well, so aren't you saying that it is vain to implement the set of infinite
words in Sage ? We will never use them, after all !

To me it makes sense to refuse to iterate on an uncountable set. I mean,
for as long as there is an easy alternative to represent the words you can
actually iterate on, i.e. the list of finite binary words !

Or just for fun we could write something like :
def __iter__():
    while True:
        yield self.random_element()

:-PPPPPPPPPPPPPPPPPPPPP

Nathann

P.S. : Oh, by the way ....
sage: Word([1,2]) in Words(2)
False

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to