On Wed, Aug 27, 2014 at 5:01 AM, Travis Scrimshaw <[email protected]> wrote:
>>
>> We already have Primes (upper case P) for that... it just need to be
>> tuned to accept lower/upper bounds. It is nicer from the user point of
>> view (as far as OOP is better than functional programming). A good
>> solution for the namespace would be to have only Primes and
>> PrimePowers.
>>
>> But I really will not use it myself because it has a classcall,
>> UniqueRepresentation, category, etc which takes lifetime to
>> initialize. My loops are rather small but I have plenty of them... so
>> having a nice Primes object would only be painful. I want to keep a
>> simple Cython function that returns list or iterator.
>>
> That would only be a problem if you're creating such a parent for almost
> every prime (which I'm pretty sure you're not doing). However if these

When you do primes, it creates a Cython class for every prime, namely
an instance of Integer.  That's not slow.

William

> fractions of a second are really that important, create a base class (in
> cython) for Primes which does the iteration and other functionality you want
> without the Sage infrastructure. +1 for using OOP here.



>
> Best,
> Travis
>
>
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sage-devel.
>
> For more options, visit https://groups.google.com/d/optout.



-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org
[email protected]

-- 
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.

Reply via email to