Replying to slabbe:
Personnally, I would delete the file combinat/words/paths.py
and rewrite it all. So if there is some problem with it, don't try too much to fix it...
Unfortunately because of sage's depreciation policy we can't just remove paths.py
, even if this is the right thing to do.
I was going to suggest that we instead remove the doc tests of the form
sage: Words("abcd") == WordPaths("abcd")
True
Without these we could have a more natural looking equality test.
Unfortunately, with this "more natural" equiality test there are now multiple doctest failures in finite_word.py and in word_generators.py. So this is not a good solution. I have not drilled down to find out why these doctests fail because this does not happen with Nathann's patch. So, as unnatural as the code looks, it is perhaps the best way to go.
Andrew