This is pretty much *the* worst gotcha of Sage.   You could do this instead:
>
> [[j/k for j in srange(1,k+1)] for k in srange(1,5)]
>
> It makes a range-like object, but respects the types of the input 
> variables of the srange, which are Integer in this case. 
>
>
Yup, this is always nasty.  Now, with Python 3 this *sort* of goes away, 
but am I correct that j/k will then give (floating point) 0.5, not a 
Rational Sage type, right?  So in some sense this will still be an issue, 
just a different one. 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" 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-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to