Ticket #5534 (closed defect: fixed)
[with patch, positive review] sage.combinat.subword.smallest_positions modifying its input (use #5200)
| Reported by: | nthiery | Owned by: | hivert |
|---|---|---|---|
| Priority: | minor | Milestone: | sage-3.4.1 |
| Component: | combinatorics | Keywords: | |
| Cc: | sage-combinat | Author(s): | |
| Report Upstream: | Reviewer(s): | ||
| Merged in: | Work issues: |
Description (last modified by hivert) (diff)
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
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

