> I really think that this is illogical. Don't you ?

No, because it's perfectly consistent.

I can see why it's not obvious, though -- and for related reasons, in
Python 3 the division of two ints produces a float (or in Python 2 if
you `from __future__ import division`).  That won't help us much
though because we need to preprocess ints into Integers anyway.

> I guess that here there are some Sage-type conversions coming from  ``+/- 
> 1*...``.

Yep.  You're multiplying a Sage Integer by a Python integer, which
produces a Sage Integer.

> From my point of view, using in Sage,  ``randint`` should produce Sage 
> integers and not Python integer.

Not an unreasonable expectation, although I would probably suggest
using a different name for the function instead to prevent confusion
with random.randint.

But in the case of integers, you could also get a random integer right
from ZZ instead (with randrange behaviour instead of randint):

sage: ZZ.random_element(10, 20)
13

So I could take or leave adding another function.


Doug

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/sage-support?hl=en.


Reply via email to