Jeroen Demeyer wrote:

> You are missing something:

Indeed! Thanks for pointing it out. That was sloppy grepping of mine.

> * finite fields are Python
> (src/sage/rings/finite_rings/finite_field_*.py)

So in this case, apparently,

 (i) the Python parent classes derive from an abstract Cython class
     (in addition to Parent, Ring, etc.);

(ii) beside their pointers to the parents, some elements store pointers
     to a separate Cyton data structure that contains the information
     that arithmetic operations need to access (same idea as the
     "shadow parent" of my first message).

Would that be the/a recommended way to get fast arithmetic on small 
objects?

Sorry if my questions are not clearly motivated by a concrete example.
I am trying to get an idea of what is current best practice and what is 
there for historical reasons among what I see in the sage library. If 
this helps, an example to which I think some of this applies is the 
beginning implementation of a RealBallField based on arb (#17194), which 
I am trying to review. But that's not the only or even the primary 
motivation of my questions.

Thanks again,

-- 
Marc

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