#16137: lazy_list from various input data
-------------------------------------+-------------------------------------
Reporter: MatthieuDien | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-6.4
Component: misc | Resolution:
Keywords: LazyPowerSeries, | Merged in:
lazy_list, days57 | Reviewers:
Authors: Vincent | Work issues:
Delecroix, Matthieu Dien | Commit:
Report Upstream: N/A | 530b21b1a97012b1adfc244dad57250922f4f46c
Branch: | Stopgaps:
public/lazy_list_from_various_input_data|
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by mantepse):
Although less elegant, we can do the following:
{{{
sage: m = lazy_list_from_function(len); m
lazy list [0, 1, 2, ...]
sage: m2 = lazy_list_from_iterator(ifilter(is_prime, m)); m2
lazy list [2, 3, 5, ...]
sage: m3 = lazy_list_from_iterator(imap(lambda a: a^2, m2)); m3
lazy list [4, 9, 25, ...]
}}}
Now I'm not quite sure anymore what the difference between an iterator and
a lazy list is precisely. Is it just the caching? How do we want to
interact with `itertools`?
--
Ticket URL: <http://trac.sagemath.org/ticket/16137#comment:42>
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.