Opened 5 years ago
Closed 5 years ago
#18148 closed defect (fixed)
No lexicographic iterator over finite binary words
Reported by:  ncohen  Owned by:  

Priority:  major  Milestone:  sage6.6 
Component:  combinatorics  Keywords:  
Cc:  nthiery, tscrim, ncohen, vdelecroix, bgillespie, aschilling, jdemeyer, slabbe  Merged in:  
Authors:  Nathann Cohen  Reviewers:  Vincent Delecroix 
Report Upstream:  N/A  Work issues:  
Branch:  1344cb7 (Commits)  Commit:  1344cb77f30c0424a2fcc7113467d384eed1ed1a 
Dependencies:  Stopgaps: 
Description
Sage implements an iterator on finite words n lexicographic order, and such a thing is not possible. In particular:
sage: w=Words([0,1],infinite=False).__iter__() sage: w.next() word: sage: w.next() word: 0 sage: sage: w.next() word: 1 sage: w.next() word: 00
I see two ways out: stop claiming that it is lexicographic, or remove the function. What do you think?
Nathann
P.S.: To whoever types "git blame" (like and did) and notices that I am the author of the function: please look at the whole commit, I only moved it to a different place :PPP
Change History (10)
comment:1 Changed 5 years ago by
 Component changed from PLEASE CHANGE to combinatorics
comment:2 Changed 5 years ago by
comment:3 Changed 5 years ago by
Makes sense to me. Should we raise a warning for a while, or do we "not care" and just change the doc?
Nathann
comment:4 Changed 5 years ago by
Just change the doc. The iterator does not have to be compatible with the ordering. And the class is not called FiniteWordsLexIterator
;P
Vincent
comment:5 Changed 5 years ago by
 Branch set to public/18148
 Commit set to 1344cb77f30c0424a2fcc7113467d384eed1ed1a
 Status changed from new to needs_review
New commits:
1344cb7  trac #18148: No lexicographic iterator over finite binary words

comment:6 Changed 5 years ago by
 Reviewers set to Vincent Delecroix
 Status changed from needs_review to positive_review
Wonderful ;) I like very much one minute tickets!
Vincent
comment:7 Changed 5 years ago by
Would you have another minute for #18067 ? :P
Nathann
comment:9 Changed 5 years ago by
 Status changed from needs_work to positive_review
comment:10 Changed 5 years ago by
 Branch changed from public/18148 to 1344cb77f30c0424a2fcc7113467d384eed1ed1a
 Resolution set to fixed
 Status changed from positive_review to closed
It is not lexicographic but shortlex (and natural and useful)! So I would vote for keeping it and adapt the documentation accordingly.
Vincent