#16320: Handle finite slices for infinite enumerate sets
-------------------------------------+-------------------------------------
Reporter: tscrim | Owner: sage-combinat
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.3
Component: categories | Resolution:
Keywords: infinite | Merged in:
enumerated set slices | Reviewers: Nathann Cohen
Authors: Travis Scrimshaw | Work issues:
Report Upstream: N/A | Commit:
Branch: | e069b7de8e84c84978db760833a675c161173287
public/infinite_enum_set_slices-16320| Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by nthiery):
This kind of slices can indeed come up handy; thanks for implementing
them!
Could we put it instead in `EnumeratedSets`? This would just require
updating
a bit the bound checks, possibly testing if ``self in
Sets().Infinite()``, right?
Also please make the doc read along the following lines::
{{{
Return the `i`-th element of ``self``, or the slice ...
INPUT:
...
.. WARNING::
This method is only meant as a convenience shorthand for
``self.unrank(i)`` and ``self.foo(...)`` respectively, for casual
use (e.g. in interactive sessions). Subclasses are hereby
explicitly permitted to overload ``__getitem__`` with a different
semantic, typically for enumerated sets that are naturally indexed
by some `I` not of the form `\{0,1,...\}`.
... EXAMPLE HERE, typically with an infinite family ...
In particular, generic code *should not* use this shorthand.
}}}
Any suggestion for the name `foo` we should use for the analog of
unrank for slices?
Cheers,
Nicolas
--
Ticket URL: <http://trac.sagemath.org/ticket/16320#comment:6>
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.