On Friday, April 17, 2015 at 11:54:29 PM UTC-4, Darij Grinberg wrote:
>
> Can anyone explain in a noob-friendly way how an implementer should decide 
> between returning ints and Integers
>

Sage functions should always return Sage integers.

A kind of corner case is if your code just works by duck-typing without 
ever needing a literal number. Then you should probably rely on coercion to 
do the right thing, so the output type matches the input type. 

when it is OK to treat them as equivalent, and in what cases an explicit 
> conversion into Integer needs to be made? Thanks a lot!
>

If in doubt, explicitly convert: ZZ(x)

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