Bug with the ASCII printing

19 views
Skip to first unread message

Christophe Bal

unread,
May 4, 2014, 9:43:54 AM5/4/14
to sympy-list
Hello.

The following terminal session shows a problem with the ASCII printing because the two last lines.

At least, I would expect the use of S(1) in the repr which is a technical output from my point of view. What do you think about this ?

Christophe BAL

-----------------------
>>> from sympy import *
>>> x = var('x')
>>> f = S(1)/4
>>> print f
1/4
>>> print(repr(f))
1/4

Aaron Meurer

unread,
May 7, 2014, 6:19:02 PM5/7/14
to sy...@googlegroups.com
repr is the same as str for SymPy, because the true repr output would
be too verbose, and Python calls repr on the elements of a list when
you call str on the list.

If you want a true repr, use srepr().

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CAAb4jG%3Dk6K1Y%3DfioZo5jLXp%2BBAXD7%2B8%2BT0dX2yEvX5PORA%3D_CA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages