#16320: Handle finite slices for infinite enumerate sets
-------------------------------------+-------------------------------------
Reporter: tscrim | Owner: sage-combinat
Type: enhancement | Status: needs_review
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: |
-------------------------------------+-------------------------------------
Comment (by vdelecroix):
What about an iterator counterpart?
{{{
def iterator(self, start=None, end=None, backward=False):
r"""
Iterates over the item in this set between the rank ``start`` and
``end``.
"""
}}}
that would even be more useful (e.g. parallel loops).
We can possibly restrict to step being `1` or `-1` in which guess I would
argue for a boolean argument `backward` which would be `False` by default.
Then we can make a cross implementation in the `ParentMethods` (i.e.
`__iter__` calling `iterator` and `iterator` calling `__iter__`). Or
possibly using `unrank`.
What do you think?
--
Ticket URL: <http://trac.sagemath.org/ticket/16320#comment:31>
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.