On Tue, Aug 26, 2014 at 3:00 PM, Vincent Delecroix
<20100.delecr...@gmail.com> 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)

1. Are you introducing a totally new convention?  Does Python put
"_iterator" after function names to emphasize iterators?  Do we do
that anywhere?   In Python 3.x at least, they explicitly try not to
name iterators differently.


2. Changing primes to return a list will break every explicit use of
primes I've ever used, in all my old code.   For example, I might use
it like this (say):

   for p in primes(10^19,10^60):
        if something(p):   break

If you change to a list, when I run the code my computer explode.

3. What motivates your suggested changes?    I don't see a
sufficiently compelling argument for breaking tons of user code in
subtle ways yet.   Sometimes that is worth doing.... but in 10 years,
I've heard no complaints before about the naming of the above
functions, so they probably aren't *horrible*.

William


>
> 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 sage-nt+unsubscr...@googlegroups.com.
> To post to this group, send an email to sage...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-nt.
> For more options, visit https://groups.google.com/d/optout.



-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org
wst...@uw.edu

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to