Ask Your Question

Revision history [back]

I think when you evaluate

mot=Word('y1')

it treats 'y' and '1' as separate characters, giving a word of length 2. Instead,

mot=Word(['y1'])

makes it have length one. To force it to live in Mots, do this:

sage: mot = Mots(Word(['y1']))
sage: Word(['y1']) in Mots
False
sage: Mots(Word(['y1'])) in Mots
True

Not ideal, but it seems to work.