#16320: Handle finite slices for infinite enumerate sets
-------------------------------------+-------------------------------------
       Reporter:  tscrim             |        Owner:  sage-combinat
           Type:  enhancement        |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-7.1
      Component:  categories         |   Resolution:
       Keywords:  infinite           |    Merged in:
  enumerated set slices              |    Reviewers:  Nathann Cohen
        Authors:  Travis Scrimshaw   |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  1dbb053cfb3f6261d30aac6d20a300bfd57a45e6
  public/infinite_enum_set_slices-16320|     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------
Changes (by tscrim):

 * status:  needs_review => needs_work


Comment:

 This breaks several doctests, some of which indicate things we definitely
 should support, specifically negative indices. Probably should try
 `self.list()[i]` first in `__getitem__` for enumerated sets and for finite
 enumerated sets, we should do `self.list()[i]` if `i < 0`.

 We probably should also rewrite the iterator and listing methods for
 (finite?) enumerated sets to use a lazy list, but I think that is best on
 a follow-up.

 For an `iterator` method, I would call it `iterator_range` for
 consistency, but I'm not opposed to it. Moreover, the logic from
 `unrank_range` could probably all be moved there and `unrank_range` just
 returns a list constructed from `iterator_range`.

--
Ticket URL: <http://trac.sagemath.org/ticket/16320#comment:32>
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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to