-
-
Notifications
You must be signed in to change notification settings - Fork 671
Closed
Description
I came across this function in Sage-Combinat,
sage.combinat.subword.smallest_positions(word, subword, pos=0)
Running this function not only returns the positions in "word" where
"subword" occurs, but it modifies "subword" to be this sequence of
positions. Is there a reason for this? It seems to me that it should
leave "subword" unchanged, but maybe I'm not thinking of something.
sage: w = ["a", "b", "c", "d"]
sage: ww = ["b", "d"]
sage: sage.combinat.subword.smallest_positions(w, ww)
[1, 3]
sage: w
['a', 'b', 'c', 'd']
sage: ww
[1, 3]
Thanks,
Steve
CC: @sagetrac-sage-combinat
Component: combinatorics
Issue created by migration from https://trac.sagemath.org/ticket/5534