#5534: sage.combinat.subword.smallest_positions modifying its input
---------------------------+------------------------------------------------
 Reporter:  nthiery        |       Owner:  mhansen      
     Type:  defect         |      Status:  new          
 Priority:  minor          |   Milestone:  sage-combinat
Component:  combinatorics  |    Keywords:               
---------------------------+------------------------------------------------
 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?
 sage: sage.combinat.subword.smallest_positions(w, ww)
 [1, 3]
 sage: w
 ['a', 'b', 'c', 'd']
 sage: ww
 [1, 3]

 Thanks,
 Steve

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5534>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to