Look at Integer.__mod__ vs. Rational.__mod__, this'll make it clear how to 
fix it.

Apparently the design decision was to call Rational.__mod__(int, Rational) 
in that case. It would be nice to have some explanation why.


On Tuesday, July 9, 2013 6:28:20 AM UTC-4, Travis Scrimshaw wrote:
>
>  
> sage: int(5) % QQ(2)
> ---------------------------------------------------------------------------
> TypeError                                 Traceback (most recent call last
> )
> <ipython-input-4-8ec0f9994ded> in <module>()
> ----> 1 int(Integer(5)) % QQ(Integer(2))
>
> TypeError: Argument 'self' has incorrect type (expected sage.rings.
> rational.Rational, got int)
>
>
>

-- 
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/groups/opt_out.


Reply via email to