#17979: Reimplementation of IntegerListsLex
-------------------------------------+-------------------------------------
       Reporter:  aschilling         |        Owner:
           Type:  defect             |       Status:  needs_work
       Priority:  blocker            |    Milestone:  sage-6.6
      Component:  combinatorics      |   Resolution:
       Keywords:  days64             |    Merged in:
        Authors:  Bryan Gillespie,   |    Reviewers:
  Anne Schilling, Nicolas M. Thiery  |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  8e51e7ba310308d0ef8787519986d01ca24bc79e
  public/ticket/17979                |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by nthiery):

 Replying to [comment:117 ncohen]:
 > I just finished reading the iterator part of that patch, and it looks
 solid.

 Cool :-) Thanks for checking!

 > Just a couple of details:
 >
 > - Shouldn't `i in ZZ` appear before the others in the following line ?
 >
 >   {{{return lambda i: l[i] if (i >= 0 and i < len(l) and i in ZZ) else
 default}}}

 Given that this is a critical section and an internal function, I just
 changed this to assume that i is a non negative integer, and only
 check on i < len(l). Does this sound ok?

 > - The documentation reads that `n` can be an iterable, but the code of
 >   `__contains__` does not agree.

 This is because `IntegerListsLex(n, ...)` returns a
 `DisjointEnumeratedSets` of `IntegerListsLex`'s if `n` is an
 iterable. This way all the rest of the code can just ignore the
 existence of this feature.

 The downside is that `__contains__` is slower (it will run through the
 different IntegerListsLex, and check contains there). Especially if
 the iterable is infinite. But that's not an important feature, so
 that's ok I believe.

--
Ticket URL: <http://trac.sagemath.org/ticket/17979#comment:128>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to