Sounds like a reasonable plan if you (or someone) can be bothered to sort out the chenges which will need to be made in code and doctests! There will be places where we now have: for p in primes(10^8): do_something_with(p) which will still work when primes() returns a list, so will not result in doctest failures, but which should be changed. This will be rather tedious.
On the plus side, I make the point that all these are functions at the top level which will be discovered by beginners for whom sage: primes(100) <generator object primes at 0x7f9335465a50> will just confuse. Experts can know about and use the iterator forms of the functions. John On 26 August 2014 14:00, Vincent Delecroix <[email protected]> wrote: > Hello, > > Right now, we have the following functions > - primes: an iterator over primes > - prime_range: a list of primes (in Cython) > - prime_powers: a list of prime powers > - prime_power_range: another function that return a list of prime > powers (in Cython from #16880) > > Given that > - we can implement iterator in Cyhon > - most function that end with 's' return lists (elliptic_curves, > prime_divisors, quadratic_residues, ...) > > What do you think about: > - move everything in Cython in `fast_arith.pyx` > - having `primes` and `prime_powers` return lists > - having `prime_iterator`and `prime_power_iterator` return iterators > (with deprecation and everything) > > Best, > Vincent > > -- > You received this message because you are subscribed to the Google Groups > "sage-nt" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send an email to [email protected]. > Visit this group at http://groups.google.com/group/sage-nt. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sage-nt" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send an email to [email protected]. Visit this group at http://groups.google.com/group/sage-nt. For more options, visit https://groups.google.com/d/optout.
