When trying to latex-print symbolic functions, I have seen the following weird behavior:

sage: P=function('P',x)
sage: latex(P(x=sin(0)))
Traceback (click to the left of this block for traceback)
...
AttributeError: 'int' object has no attribute '_latex_'

The superficial reason for this behavior is that, if a symbolic function has arguments without a _latex_ attribute, then its latex printing fails. This is easy to fix, I have written a (very easy to review) patch in TRAC 13632.

However, the deeper reason is that, even when 0 is a sage integer, sin(0) is a Python integer:

sage: type(sin(0))
<type 'int'>

I was wondering if this behavior was by design, or how it could be fixed.

By the way, if I understand things correctly, it can even happen in a similar situation that the product of two sage integers is a Python integer:

sage: var('x, y, z')
sage: P=function('P', x)
sage: latex(P(x=y*z)(y=0, z=0))
Traceback (click to the left of this block for traceback)
...
AttributeError: 'int' object has no attribute '_latex_'


SG







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


Reply via email to